Merge pull request #11660 from nkcsgexi/code-expand-trailing

This commit is contained in:
swift-ci
2017-08-28 14:24:35 -07:00
committed by GitHub
2 changed files with 14 additions and 2 deletions

View File

@@ -81,3 +81,10 @@ func f1() {
// CHECK: bar(a : {}}, <#T##d: () -> ()##() -> ()#>)
foo(withDuration: 1, animations: <#T##() -> Void#>)
if true {
withtrail(<#T##() -> ()#>)
// CHECK: withtrail {
// CHECK-NEXT: <#code#>
}
}

View File

@@ -1481,9 +1481,14 @@ private:
bool walkToStmtPre(Stmt *S) override {
auto SR = S->getSourceRange();
if (SR.isValid() && SM.rangeContainsTokenLoc(SR, TargetLoc)) {
if (!EnclosingCall && !isa<BraceStmt>(S))
if (!EnclosingCall) {
if (isa<BraceStmt>(S))
// In case OuterStmt is already set, we should clear it to nullptr.
OuterStmt = nullptr;
else
OuterStmt = S;
}
}
return true;
}