Skip to content

Commit 6df132d

Browse files
[ConstraintSystem] Make getCalleLocator to support an apply involving an dynamicCallable
1 parent 261e9e4 commit 6df132d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,13 @@ ConstraintLocator *ConstraintSystem::getCalleeLocator(
513513
{LocatorPathElt::ApplyFunction(),
514514
LocatorPathElt::ImplicitCallAsFunction()});
515515
}
516+
517+
// Handling an apply for a nominal type that supports @dynamicCallable.
518+
auto nominal = fnTy->getAnyNominal();
519+
if (nominal && nominal->getAttrs().hasAttribute<DynamicCallableAttr>()) {
520+
return getConstraintLocator(anchor, LocatorPathElt::ApplyFunction());
521+
}
522+
516523
return nullptr;
517524
};
518525

0 commit comments

Comments
 (0)