mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
}`
23 KiB
23 KiB