mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Constraint solver] Fix backward trailing closures with ".member" expressions
The introduction of forward-scan matching for trailing closures (SE-0286) failed to account for unresolved member expressions, sometimes causing a crash in SILGen. Fixes rdar://problem/67781123.
This commit is contained in:
@@ -5592,7 +5592,9 @@ 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::Call) ||
|
||||
anchor.isExpr(ExprKind::Subscript) ||
|
||||
anchor.isExpr(ExprKind::UnresolvedMember))) {
|
||||
auto locatorPtr = cs.getConstraintLocator(locator);
|
||||
assert(solution.trailingClosureMatchingChoices.count(locatorPtr) == 1);
|
||||
trailingClosureMatching = solution.trailingClosureMatchingChoices.find(
|
||||
|
||||
Reference in New Issue
Block a user