Skip to content

Commit

Permalink
[Constraint application] Find trailing closure direction more carefully.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DougGregor committed Aug 31, 2020
1 parent 0b2b7b5 commit cabcbc9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/Sema/CSApply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5592,9 +5592,7 @@ Expr *ExprRewriter::coerceCallArguments(
SmallVector<LocatorPathElt, 4> path;
auto anchor = locator.getLocatorParts(path);
if (!path.empty() && path.back().is<LocatorPathElt::ApplyArgument>() &&
(anchor.isExpr(ExprKind::Call) ||
anchor.isExpr(ExprKind::Subscript) ||
anchor.isExpr(ExprKind::UnresolvedMember))) {
!anchor.isExpr(ExprKind::UnresolvedDot)) {
auto locatorPtr = cs.getConstraintLocator(locator);
assert(solution.trailingClosureMatchingChoices.count(locatorPtr) == 1);
trailingClosureMatching = solution.trailingClosureMatchingChoices.find(
Expand Down

0 comments on commit cabcbc9

Please sign in to comment.