Skip to content

Commit

Permalink
add a testcase for a bug that was fixed along the way.
Browse files Browse the repository at this point in the history
  • Loading branch information
lattner committed Aug 1, 2016
1 parent c22258d commit 9d1ab28
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/NameBinding/name_lookup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -516,3 +516,22 @@ class r16954496 {
lazy var x: Array<(r16954496) -> () -> Void> = [bar]
}



// <rdar://problem/27413116> [Swift] Using static constant defined in enum when in switch statement doesnt compile
enum MyEnum {
case one
case two

static let kMyConstant = "myConstant"
}

switch "someString" {
case MyEnum.kMyConstant: // this causes a compiler error
print("yay")
case MyEnum.self.kMyConstant: // this works fine
print("hmm")
default:
break
}

0 comments on commit 9d1ab28

Please sign in to comment.