Skip to content

Commit be7da31

Browse files
author
Nathan Hawes
authored
Merge pull request #23468 from nathawes/fix-case-var-for-relatedidents-cursorinfo-and-rename-5.1
[5.1][sourcekitd] Improve CursorInfo, RelatedIdents, and local rename to better handle VarDecls involved in case fallthroughs
2 parents 1fa1d2d + 50f6ddb commit be7da31

20 files changed

+275
-25
lines changed

lib/AST/USRGeneration.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ static bool shouldUseObjCUSR(const Decl *D) {
167167
llvm::Expected<std::string>
168168
swift::USRGenerationRequest::evaluate(Evaluator &evaluator,
169169
const ValueDecl *D) const {
170+
if (auto *VD = dyn_cast<VarDecl>(D))
171+
D = VD->getCanonicalVarDecl();
172+
170173
if (!D->hasName() && !isa<ParamDecl>(D) && !isa<AccessorDecl>(D))
171174
return std::string(); // Ignore.
172175
if (D->getModuleContext()->isBuiltinModule())

lib/IDE/SwiftSourceDocInfo.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,19 @@ bool CursorInfoResolver::tryResolve(ValueDecl *D, TypeDecl *CtorTyRef,
7979
if (!D->hasName())
8080
return false;
8181

82-
if (Loc == LocToResolve) {
83-
CursorInfo.setValueRef(D, CtorTyRef, ExtTyRef, IsRef, Ty, ContainerType);
84-
return true;
82+
if (Loc != LocToResolve)
83+
return false;
84+
85+
if (auto *VD = dyn_cast<VarDecl>(D)) {
86+
// Handle references to the implicitly generated vars in case statements
87+
// matching multiple patterns
88+
if (VD->isImplicit()) {
89+
if (auto * Parent = VD->getParentVarDecl())
90+
D = Parent;
91+
}
8592
}
86-
return false;
93+
CursorInfo.setValueRef(D, CtorTyRef, ExtTyRef, IsRef, Ty, ContainerType);
94+
return true;
8795
}
8896

8997
bool CursorInfoResolver::tryResolve(ModuleEntity Mod, SourceLoc Loc) {

lib/Index/Index.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,12 @@ class IndexSwiftASTWalker : public SourceEntityWalker {
516516
}
517517

518518
bool shouldIndex(ValueDecl *D, bool IsRef) const {
519+
if (D->isImplicit() && isa<VarDecl>(D) && IsRef) {
520+
// Bypass the implicit VarDecls introduced in CaseStmt bodies by using the
521+
// canonical VarDecl for these checks instead.
522+
D = cast<VarDecl>(D)->getCanonicalVarDecl();
523+
}
524+
519525
if (D->isImplicit() && !isa<ConstructorDecl>(D))
520526
return false;
521527

@@ -1151,6 +1157,11 @@ bool IndexSwiftASTWalker::reportImplicitConformance(ValueDecl *witness, ValueDec
11511157
bool IndexSwiftASTWalker::initIndexSymbol(ValueDecl *D, SourceLoc Loc,
11521158
bool IsRef, IndexSymbol &Info) {
11531159
assert(D);
1160+
if (auto *VD = dyn_cast<VarDecl>(D)) {
1161+
// Always base the symbol information on the canonical VarDecl
1162+
D = VD->getCanonicalVarDecl();
1163+
}
1164+
11541165
Info.decl = D;
11551166
Info.symInfo = getSymbolInfoForDecl(D);
11561167
if (Info.symInfo.Kind == SymbolKind::Unknown)

lib/Parse/ParseStmt.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,6 @@ static void parseGuardedPattern(Parser &P, GuardedPattern &result,
12041204

12051205
for (auto VD : repeatedDecls) {
12061206
VD->setHasNonPatternBindingInit();
1207-
VD->setImplicit();
12081207
}
12091208

12101209
// Parse the optional 'where' guard, with this particular pattern's bound

lib/Sema/MiscDiagnostics.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2450,6 +2450,20 @@ VarDeclUsageChecker::~VarDeclUsageChecker() {
24502450
auto *var = elt.first;
24512451
unsigned access = elt.second;
24522452

2453+
if (auto *CS = dyn_cast_or_null<CaseStmt>(var->getRecursiveParentPatternStmt())) {
2454+
// Only diagnose VarDecls from the first CaseLabelItem in CaseStmts, as
2455+
// the remaining items must match it anyway.
2456+
auto CaseItems = CS->getCaseLabelItems();
2457+
if (!CaseItems.empty()) {
2458+
bool InFirstCaseLabelItem = false;
2459+
CaseItems.front().getPattern()->forEachVariable([&](VarDecl *D) {
2460+
InFirstCaseLabelItem |= var == D;
2461+
});
2462+
if (!InFirstCaseLabelItem)
2463+
continue;
2464+
}
2465+
}
2466+
24532467
// If this is a 'let' value, any stores to it are actually initializations,
24542468
// not mutations.
24552469
auto isWrittenLet = false;

test/Index/local.swift

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,47 @@ func foo(a: Int, b: Int, c: Int) {
3535
let _ = LocalEnum.foo(x: LocalStruct())
3636
// LOCAL: [[@LINE-1]]:13 | enum(local)/Swift | LocalEnum | [[LocalEnum_USR]] | Ref,RelCont | rel: 1
3737
// CHECK-NOT: [[@LINE-2]]:13 | enum(local)/Swift | LocalEnum | [[LocalEnum_USR]] | Ref,RelCont | rel: 1
38-
// LOCAL: [[@LINE-3]]:23 | enumerator(local)/Swift | foo(x:) | [[LocalEnum_foo_USR]] | Ref,RelCont | rel: 1
38+
// LOCAL: [[@LINE-3]]:23 | enumerator(local)/Swift | foo(x:) | [[LocalEnum_foo_USR]] | Ref,RelCont | rel: 1
3939
// CHECK-NOT: [[@LINE-4]]:23 | enumerator(local)/Swift | foo(x:) | [[LocalEnum_foo_USR]] | Ref,RelCont | rel: 1
4040
// LOCAL: [[@LINE-5]]:30 | struct(local)/Swift | LocalStruct | [[LocalStruct_USR]] | Ref,RelCont | rel: 1
4141
// CHECK-NOT: [[@LINE-6]]:30 | struct(local)/Swift | LocalStruct | [[LocalStruct_USR]] | Ref,RelCont | rel: 1
4242

4343
}
44+
45+
func bar(arg: Int?) {
46+
switch arg {
47+
case let .some(x) where x == 0:
48+
// LOCAL: [[@LINE-1]]:18 | variable(local)/Swift | x | [[x_USR:.*]] | Def,RelChild | rel: 1
49+
// LOCAL: [[@LINE-2]]:27 | variable(local)/Swift | x | [[x_USR]] | Ref,Read,RelCont | rel: 1
50+
// CHECK-NOT: [[@LINE-3]]:18 | variable(local)/Swift | x | [[x_USR:.*]] | Def,RelChild | rel: 1
51+
// CHECK-NOT: [[@LINE-4]]:27 | variable(local)/Swift | x | [[x_USR]] | Ref,Read,RelCont | rel: 1
52+
print(x)
53+
// LOCAL: [[@LINE-1]]:11 | variable(local)/Swift | x | [[x_USR]] | Ref,Read,RelCont | rel: 1
54+
// CHECK-NOT: [[@LINE-2]]:11 | variable(local)/Swift | x | [[x_USR]] | Ref,Read,RelCont | rel: 1
55+
56+
case let .some(x) where x == 1,
57+
// LOCAL: [[@LINE-1]]:18 | variable(local)/Swift | x | [[x2_USR:.*]] | Def,RelChild | rel: 1
58+
// LOCAL: [[@LINE-2]]:27 | variable(local)/Swift | x | [[x2_USR]] | Ref,Read,RelCont | rel: 1
59+
// CHECK-NOT: [[@LINE-3]]:18 | variable(local)/Swift | x | [[x2_USR:.*]] | Def,RelChild | rel: 1
60+
// CHECK-NOT: [[@LINE-4]]:27 | variable(local)/Swift | x | [[x2_USR]] | Ref,Read,RelCont | rel: 1
61+
let .some(x) where x == 2:
62+
// LOCAL: [[@LINE-1]]:18 | variable(local)/Swift | x | [[x2_USR]] | Def,RelChild | rel: 1
63+
// LOCAL: [[@LINE-2]]:27 | variable(local)/Swift | x | [[x2_USR]] | Ref,Read,RelCont | rel: 1
64+
// CHECK-NOT: [[@LINE-3]]:18 | variable(local)/Swift | x | [[x2_USR]] | Def,RelChild | rel: 1
65+
// CHECK-NOT: [[@LINE-4]]:27 | variable(local)/Swift | x | [[x2_USR]] | Ref,Read,RelCont | rel: 1
66+
print(x)
67+
// LOCAL: [[@LINE-1]]:11 | variable(local)/Swift | x | [[x2_USR]] | Ref,Read,RelCont | rel: 1
68+
// CHECK-NOT: [[@LINE-2]]:11 | variable(local)/Swift | x | [[x2_USR]] | Ref,Read,RelCont | rel: 1
69+
fallthrough
70+
case let .some(x) where x == 3:
71+
// LOCAL: [[@LINE-1]]:18 | variable(local)/Swift | x | [[x2_USR]] | Def,RelChild | rel: 1
72+
// LOCAL: [[@LINE-2]]:27 | variable(local)/Swift | x | [[x2_USR]] | Ref,Read,RelCont | rel: 1
73+
// CHECK-NOT: [[@LINE-1]]:18 | variable(local)/Swift | x | [[x2_USR]] | Def,RelChild | rel: 1
74+
// CHECK-NOT: [[@LINE-2]]:27 | variable(local)/Swift | x | [[x2_USR]] | Ref,Read,RelCont | rel: 1
75+
print(x)
76+
// LOCAL: [[@LINE-1]]:11 | variable(local)/Swift | x | [[x2_USR]] | Ref,Read,RelCont | rel: 1
77+
// CHECK-NOT: [[@LINE-1]]:11 | variable(local)/Swift | x | [[x2_USR]] | Ref,Read,RelCont | rel: 1
78+
default:
79+
break
80+
}
81+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
enum X {
3+
case first(Int, String)
4+
case second(Int, String)
5+
case third(Int, String)
6+
case fourth(Int, String)
7+
case fifth(Int, String)
8+
}
9+
10+
let p = X.first(3, "hello")
11+
12+
switch p {
13+
case .first(let x, let y)
14+
print("foo \(x) \(y)")
15+
fallthrough
16+
case .second(let x, let y), .third(let x, let y):
17+
print("bar \(x) \(y)")
18+
default:
19+
print("other")
20+
}
21+
22+
// RUN: %sourcekitd-test -req=cursor -pos=13:19 %s -- %mcp_opt %s | %FileCheck -check-prefixes=CHECKX,CHECK1DECL %s
23+
// RUN: %sourcekitd-test -req=cursor -pos=14:18 %s -- %mcp_opt %s | %FileCheck -check-prefixes=CHECKX,CHECK1REF %s
24+
25+
// CHECK1DECL: source.lang.swift.decl.var.local (13:19-13:20)
26+
// CHECK1REF: source.lang.swift.ref.var.local (13:19-13:20)
27+
28+
// RUN: %sourcekitd-test -req=cursor -pos=16:20 %s -- %mcp_opt %s | %FileCheck -check-prefixes=CHECKX,CHECK2DECL %s
29+
// RUN: %sourcekitd-test -req=cursor -pos=16:42 %s -- %mcp_opt %s | %FileCheck -check-prefixes=CHECKX,CHECK2DECL2 %s
30+
// RUN: %sourcekitd-test -req=cursor -pos=17:18 %s -- %mcp_opt %s | %FileCheck -check-prefixes=CHECKX,CHECK2REF %s
31+
32+
// CHECK2DECL: source.lang.swift.decl.var.local (16:20-16:21)
33+
// CHECK2DECL2: source.lang.swift.decl.var.local (16:42-16:43)
34+
// CHECK2REF: source.lang.swift.ref.var.local (16:20-16:21)
35+
36+
// CHECKX: x
37+
// CHECKX: s:33cursor_vardecl_across_fallthrough1xL_Sivp
38+
// CHECKX: Int
39+
40+
41+
// RUN: %sourcekitd-test -req=cursor -pos=13:26 %s -- %mcp_opt %s | %FileCheck -check-prefixes=CHECKY,CHECK3DECL %s
42+
// RUN: %sourcekitd-test -req=cursor -pos=14:23 %s -- %mcp_opt %s | %FileCheck -check-prefixes=CHECKY,CHECK3REF %s
43+
44+
// CHECK3DECL: source.lang.swift.decl.var.local (13:26-13:27)
45+
// CHECK3REF: source.lang.swift.ref.var.local (13:26-13:27)
46+
47+
// RUN: %sourcekitd-test -req=cursor -pos=16:27 %s -- %mcp_opt %s | %FileCheck -check-prefixes=CHECKY,CHECK4DECL %s
48+
// RUN: %sourcekitd-test -req=cursor -pos=16:49 %s -- %mcp_opt %s | %FileCheck -check-prefixes=CHECKY,CHECK4DECL2 %s
49+
// RUN: %sourcekitd-test -req=cursor -pos=17:23 %s -- %mcp_opt %s | %FileCheck -check-prefixes=CHECKY,CHECK4REF %s
50+
51+
// CHECK4DECL: source.lang.swift.decl.var.local (16:27-16:28)
52+
// CHECK4DECL2: source.lang.swift.decl.var.local (16:49-16:50)
53+
// CHECK4REF: source.lang.swift.ref.var.local (16:27-16:28)
54+
55+
// CHECKY: y
56+
// CHECKY: s:33cursor_vardecl_across_fallthrough1yL_SSvp
57+
// CHECKY: String

test/SourceKit/RelatedIdents/related_idents.swift

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@ class C2<Param> {
2323
func f(t : Param) -> Param {return t}
2424
}
2525

26+
enum X {
27+
case first(Int, String)
28+
case second(Int, String)
29+
case third(Int, String)
30+
case fourth(Int, String)
31+
}
32+
33+
switch X.first(2, "") {
34+
case .first(let x, let y):
35+
print(y)
36+
fallthrough
37+
case .second(let x, _):
38+
print(x)
39+
case .third(let x, let y):
40+
fallthrough
41+
case .fourth(let x, let y):
42+
print(y)
43+
print(x)
44+
break
45+
}
46+
2647
// RUN: %sourcekitd-test -req=related-idents -pos=6:17 %s -- -module-name related_idents %s | %FileCheck -check-prefix=CHECK1 %s
2748
// CHECK1: START RANGES
2849
// CHECK1-NEXT: 1:7 - 2
@@ -53,3 +74,37 @@ class C2<Param> {
5374
// CHECK5-NEXT: 23:13 - 5
5475
// CHECK5-NEXT: 23:23 - 5
5576
// CHECK5-NEXT: END RANGES
77+
78+
// RUN: %sourcekitd-test -req=related-idents -pos=34:19 %s -- -module-name related_idents %s | %FileCheck -check-prefix=CHECK6 %s
79+
// RUN: %sourcekitd-test -req=related-idents -pos=37:20 %s -- -module-name related_idents %s | %FileCheck -check-prefix=CHECK6 %s
80+
// RUN: %sourcekitd-test -req=related-idents -pos=38:11 %s -- -module-name related_idents %s | %FileCheck -check-prefix=CHECK6 %s
81+
// CHECK6: START RANGES
82+
// CHECK6-NEXT: 34:19 - 1
83+
// CHECK6-NEXT: 37:20 - 1
84+
// CHECK6-NEXT: 38:11 - 1
85+
// CHECK6-NEXT: END RANGES
86+
87+
// RUN: %sourcekitd-test -req=related-idents -pos=34:26 %s -- -module-name related_idents %s | %FileCheck -check-prefix=CHECK7 %s
88+
// RUN: %sourcekitd-test -req=related-idents -pos=35:11 %s -- -module-name related_idents %s | %FileCheck -check-prefix=CHECK7 %s
89+
// CHECK7: START RANGES
90+
// CHECK7-NEXT: 34:26 - 1
91+
// CHECK7-NEXT: 35:11 - 1
92+
// CHECK7-NEXT: END RANGES
93+
94+
// RUN: %sourcekitd-test -req=related-idents -pos=39:26 %s -- -module-name related_idents %s | %FileCheck -check-prefix=CHECK8 %s
95+
// RUN: %sourcekitd-test -req=related-idents -pos=41:27 %s -- -module-name related_idents %s | %FileCheck -check-prefix=CHECK8 %s
96+
// RUN: %sourcekitd-test -req=related-idents -pos=42:11 %s -- -module-name related_idents %s | %FileCheck -check-prefix=CHECK8 %s
97+
// CHECK8: START RANGES
98+
// CHECK8-NEXT: 39:26 - 1
99+
// CHECK8-NEXT: 41:27 - 1
100+
// CHECK8-NEXT: 42:11 - 1
101+
// CHECK8-NEXT: END RANGES
102+
103+
// RUN: %sourcekitd-test -req=related-idents -pos=39:19 %s -- -module-name related_idents %s | %FileCheck -check-prefix=CHECK9 %s
104+
// RUN: %sourcekitd-test -req=related-idents -pos=41:20 %s -- -module-name related_idents %s | %FileCheck -check-prefix=CHECK9 %s
105+
// RUN: %sourcekitd-test -req=related-idents -pos=43:11 %s -- -module-name related_idents %s | %FileCheck -check-prefix=CHECK9 %s
106+
// CHECK9: START RANGES
107+
// CHECK9-NEXT: 39:19 - 1
108+
// CHECK9-NEXT: 41:20 - 1
109+
// CHECK9-NEXT: 43:11 - 1
110+
// CHECK9-NEXT: END RANGES

test/refactoring/rename/Outputs/local/casebind_1.swift.expected

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ func test3(arg: Int?) {
2121
case let .some(xRenamed) where xRenamed == 0:
2222
print(xRenamed)
2323
case let .some(x) where x == 1,
24-
let .some(x) where x == 2: // FIXME: This 'x' in '.some(x)' isn't properly renamed in 'casebind_2' case.
24+
let .some(x) where x == 2:
25+
print(x)
26+
fallthrough
27+
case let .some(x) where x == 3:
2528
print(x)
2629
default:
2730
break

test/refactoring/rename/Outputs/local/casebind_2.swift.expected

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ func test3(arg: Int?) {
2121
case let .some(x) where x == 0:
2222
print(x)
2323
case let .some(xRenamed) where xRenamed == 1,
24-
let .some(x) where x == 2: // FIXME: This 'x' in '.some(x)' isn't properly renamed in 'casebind_2' case.
24+
let .some(xRenamed) where xRenamed == 2:
25+
print(xRenamed)
26+
fallthrough
27+
case let .some(xRenamed) where xRenamed == 3:
2528
print(xRenamed)
2629
default:
2730
break

test/refactoring/rename/Outputs/local/catch_1.swift.expected

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ func test3(arg: Int?) {
2121
case let .some(x) where x == 0:
2222
print(x)
2323
case let .some(x) where x == 1,
24-
let .some(x) where x == 2: // FIXME: This 'x' in '.some(x)' isn't properly renamed in 'casebind_2' case.
24+
let .some(x) where x == 2:
25+
print(x)
26+
fallthrough
27+
case let .some(x) where x == 3:
2528
print(x)
2629
default:
2730
break

test/refactoring/rename/Outputs/local/catch_2.swift.expected

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ func test3(arg: Int?) {
2121
case let .some(x) where x == 0:
2222
print(x)
2323
case let .some(x) where x == 1,
24-
let .some(x) where x == 2: // FIXME: This 'x' in '.some(x)' isn't properly renamed in 'casebind_2' case.
24+
let .some(x) where x == 2:
25+
print(x)
26+
fallthrough
27+
case let .some(x) where x == 3:
2528
print(x)
2629
default:
2730
break

test/refactoring/rename/Outputs/local/ifbind_1.swift.expected

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ func test3(arg: Int?) {
2121
case let .some(x) where x == 0:
2222
print(x)
2323
case let .some(x) where x == 1,
24-
let .some(x) where x == 2: // FIXME: This 'x' in '.some(x)' isn't properly renamed in 'casebind_2' case.
24+
let .some(x) where x == 2:
25+
print(x)
26+
fallthrough
27+
case let .some(x) where x == 3:
2528
print(x)
2629
default:
2730
break

test/refactoring/rename/Outputs/local/ifbind_2.swift.expected

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ func test3(arg: Int?) {
2121
case let .some(x) where x == 0:
2222
print(x)
2323
case let .some(x) where x == 1,
24-
let .some(x) where x == 2: // FIXME: This 'x' in '.some(x)' isn't properly renamed in 'casebind_2' case.
24+
let .some(x) where x == 2:
25+
print(x)
26+
fallthrough
27+
case let .some(x) where x == 3:
2528
print(x)
2629
default:
2730
break

test/refactoring/rename/Outputs/local/localvar_1.swift.expected

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ func test3(arg: Int?) {
2121
case let .some(x) where x == 0:
2222
print(x)
2323
case let .some(x) where x == 1,
24-
let .some(x) where x == 2: // FIXME: This 'x' in '.some(x)' isn't properly renamed in 'casebind_2' case.
24+
let .some(x) where x == 2:
25+
print(x)
26+
fallthrough
27+
case let .some(x) where x == 3:
2528
print(x)
2629
default:
2730
break

test/refactoring/rename/Outputs/local/localvar_2.swift.expected

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ func test3(arg: Int?) {
2121
case let .some(x) where x == 0:
2222
print(x)
2323
case let .some(x) where x == 1,
24-
let .some(x) where x == 2: // FIXME: This 'x' in '.some(x)' isn't properly renamed in 'casebind_2' case.
24+
let .some(x) where x == 2:
25+
print(x)
26+
fallthrough
27+
case let .some(x) where x == 3:
2528
print(x)
2629
default:
2730
break

test/refactoring/rename/Outputs/local/param_1.swift.expected

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ func test3(arg: Int?) {
2121
case let .some(x) where x == 0:
2222
print(x)
2323
case let .some(x) where x == 1,
24-
let .some(x) where x == 2: // FIXME: This 'x' in '.some(x)' isn't properly renamed in 'casebind_2' case.
24+
let .some(x) where x == 2:
25+
print(x)
26+
fallthrough
27+
case let .some(x) where x == 3:
2528
print(x)
2629
default:
2730
break

test/refactoring/rename/Outputs/local/param_2.swift.expected

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ func test3(arg: Int?) {
2121
case let .some(x) where x == 0:
2222
print(x)
2323
case let .some(x) where x == 1,
24-
let .some(x) where x == 2: // FIXME: This 'x' in '.some(x)' isn't properly renamed in 'casebind_2' case.
24+
let .some(x) where x == 2:
25+
print(x)
26+
fallthrough
27+
case let .some(x) where x == 3:
2528
print(x)
2629
default:
2730
break

0 commit comments

Comments
 (0)