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(
55725572 SmallVector<LocatorPathElt, 4 > path;
55735573 auto anchor = locator.getLocatorParts (path);
55745574 if (!path.empty () && path.back ().is <LocatorPathElt::ApplyArgument>() &&
5575- ( anchor.isExpr (ExprKind::Call) || anchor. isExpr (ExprKind::Subscript) )) {
5575+ ! anchor.isExpr (ExprKind::UnresolvedDot )) {
55765576 auto locatorPtr = cs.getConstraintLocator (locator);
55775577 assert (solution.trailingClosureMatchingChoices .count (locatorPtr) == 1 );
55785578 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