File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -5572,7 +5572,7 @@ Expr *ExprRewriter::coerceCallArguments(
5572
5572
SmallVector<LocatorPathElt, 4 > path;
5573
5573
auto anchor = locator.getLocatorParts (path);
5574
5574
if (!path.empty () && path.back ().is <LocatorPathElt::ApplyArgument>() &&
5575
- ( anchor.isExpr (ExprKind::Call) || anchor. isExpr (ExprKind::Subscript) )) {
5575
+ ! anchor.isExpr (ExprKind::UnresolvedDot )) {
5576
5576
auto locatorPtr = cs.getConstraintLocator (locator);
5577
5577
assert (solution.trailingClosureMatchingChoices .count (locatorPtr) == 1 );
5578
5578
trailingClosureMatching = solution.trailingClosureMatchingChoices .find (
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-emit-silgen %s | %FileCheck %s
2
+
3
+ // rdar://problem/67781123 - crash in SILGen
4
+
5
+ struct Foo {
6
+ var title : String
7
+ var handler1 : ( ( Int , String ) -> Void ) ?
8
+ var handler2 : ( ( ) -> Void ) ?
9
+ }
10
+
11
+ func take( foo: Foo ) { }
12
+
13
+ // CHECK-LABEL: sil hidden [ossa] @$s42forward_trailing_closure_unresolved_member4testyy
14
+ func test( ) {
15
+ // CHECK: function_ref @$s42forward_trailing_closure_unresolved_member4testyyFyycfU_ : $@convention(thin) () -> ()
16
+ take ( foo: . init( title: " " ) {
17
+ print ( " handler2 is called " )
18
+ } )
19
+ }
You can’t perform that action at this time.
0 commit comments