Skip to content

Commit 9d1ab28

Browse files
committed
add a testcase for a bug that was fixed along the way.
1 parent c22258d commit 9d1ab28

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/NameBinding/name_lookup.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,3 +516,22 @@ class r16954496 {
516516
lazy var x: Array<(r16954496) -> () -> Void> = [bar]
517517
}
518518

519+
520+
521+
// <rdar://problem/27413116> [Swift] Using static constant defined in enum when in switch statement doesnt compile
522+
enum MyEnum {
523+
case one
524+
case two
525+
526+
static let kMyConstant = "myConstant"
527+
}
528+
529+
switch "someString" {
530+
case MyEnum.kMyConstant: // this causes a compiler error
531+
print("yay")
532+
case MyEnum.self.kMyConstant: // this works fine
533+
print("hmm")
534+
default:
535+
break
536+
}
537+

0 commit comments

Comments
 (0)