File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
test/SourceKit/CodeExpand
tools/SourceKit/lib/SwiftLang Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -81,3 +81,10 @@ func f1() {
8181// CHECK: bar(a : {}}, <#T##d: () -> ()##() -> ()#>)
8282
8383foo( withDuration: 1 , animations: < #T##( ) - > Void#> )
84+
85+ if true {
86+ withtrail ( < #T##( ) - > ( ) #> )
87+ // CHECK: withtrail {
88+ // CHECK-NEXT: <#code#>
89+ }
90+ }
Original file line number Diff line number Diff line change @@ -1481,8 +1481,13 @@ class PlaceholderExpansionScanner {
14811481 bool walkToStmtPre (Stmt *S) override {
14821482 auto SR = S->getSourceRange ();
14831483 if (SR.isValid () && SM.rangeContainsTokenLoc (SR, TargetLoc)) {
1484- if (!EnclosingCall && !isa<BraceStmt>(S))
1485- OuterStmt = S;
1484+ if (!EnclosingCall) {
1485+ if (isa<BraceStmt>(S))
1486+ // In case OuterStmt is already set, we should clear it to nullptr.
1487+ OuterStmt = nullptr ;
1488+ else
1489+ OuterStmt = S;
1490+ }
14861491 }
14871492 return true ;
14881493 }
You can’t perform that action at this time.
0 commit comments