Skip to content

Commit 6ba0ff8

Browse files
committed
[Constraint application] Find trailing closure direction more carefully.
Rather than trying to include each expression kind, which leaves us open to errors of omission, exclude only the case where we don't record locators for trailing closure directions. (cherry picked from commit cabcbc9)
1 parent 239486d commit 6ba0ff8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/CSApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5703,7 +5703,7 @@ Expr *ExprRewriter::coerceCallArguments(
57035703
SmallVector<LocatorPathElt, 4> path;
57045704
auto anchor = locator.getLocatorParts(path);
57055705
if (!path.empty() && path.back().is<LocatorPathElt::ApplyArgument>() &&
5706-
(isa<CallExpr>(anchor) || isa<SubscriptExpr>(anchor))) {
5706+
!isa<UnresolvedDotExpr>(anchor)) {
57075707
auto locatorPtr = cs.getConstraintLocator(locator);
57085708
assert(solution.trailingClosureMatchingChoices.count(locatorPtr) == 1);
57095709
trailingClosureMatching = solution.trailingClosureMatchingChoices.find(

0 commit comments

Comments
 (0)