Files
swift-mirror/test/Parse/enum.swift
Angela Laar 4308a1407b [Sema] Compiler should diagnose non-unique raw values without crashing
Enums with raw type `: String ` use the case name as the raw
value. So, two identical case names cause an identical raw value
error. Also, identical case names cause a separate redeclaration
error. The second error is diagnosed in a separate request in the
DeclVisitor. We may need a special case for this situation to
ignore the first error and defer diagnosing to the
CheckRedeclarationRequest. For now we will diagnose both errors.

`enum Foo : String {
    case Bar
    case Bar = "FooBar" // redclaration error only
    case Bar // redeclaration and raw value error
}`
2023-03-21 16:01:43 -07:00

23 KiB