File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
test/refactoring/RefactoringKind Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1884,8 +1884,11 @@ class ExpandableBindingTernaryExprInfo: public ExpandableTernaryExprInfo {
1884
1884
Binding (Binding) {}
1885
1885
1886
1886
IfExpr *getIf () {
1887
- if (Binding && Binding->getNumPatternEntries () == 1 )
1888
- return dyn_cast<IfExpr>(Binding->getInit (0 ));
1887
+ if (Binding && Binding->getNumPatternEntries () == 1 ) {
1888
+ if (auto *Init = Binding->getInit (0 )) {
1889
+ return dyn_cast<IfExpr>(Init);
1890
+ }
1891
+ }
1889
1892
1890
1893
return nullptr ;
1891
1894
}
Original file line number Diff line number Diff line change @@ -5,7 +5,9 @@ func foo() {
5
5
doit {
6
6
let s = S ( )
7
7
}
8
+ var a : Int
8
9
}
9
10
10
11
// RUN: %refactor -source-filename %s -pos=6:5 -end-pos=6:13 | %FileCheck %s -check-prefix=CHECK1
12
+ // RUN: %refactor -source-filename %s -pos=8:1 -end-pos=8:13 | %FileCheck %s -check-prefix=CHECK1
11
13
// CHECK1: Action begins
You can’t perform that action at this time.
0 commit comments