Skip to content

Commit cabcbc9

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.
1 parent 0b2b7b5 commit cabcbc9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/Sema/CSApply.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5592,9 +5592,7 @@ Expr *ExprRewriter::coerceCallArguments(
55925592
SmallVector<LocatorPathElt, 4> path;
55935593
auto anchor = locator.getLocatorParts(path);
55945594
if (!path.empty() && path.back().is<LocatorPathElt::ApplyArgument>() &&
5595-
(anchor.isExpr(ExprKind::Call) ||
5596-
anchor.isExpr(ExprKind::Subscript) ||
5597-
anchor.isExpr(ExprKind::UnresolvedMember))) {
5595+
!anchor.isExpr(ExprKind::UnresolvedDot)) {
55985596
auto locatorPtr = cs.getConstraintLocator(locator);
55995597
assert(solution.trailingClosureMatchingChoices.count(locatorPtr) == 1);
56005598
trailingClosureMatching = solution.trailingClosureMatchingChoices.find(

0 commit comments

Comments
 (0)