- Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfdeclarationsFeature: declarationsFeature: declarationsenumFeature → type declarations: Swift enumeration declarationsFeature → type declarations: Swift enumeration declarationsenum casesFeature → enums: Enum casesFeature → enums: Enum casesoverloadingFeature: Overloading symbol namesFeature: Overloading symbol namespattern matchingFeature: pattern matchingFeature: pattern matchingpatternsFeature: patternsFeature: patternsswift 5.9type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysisunexpected errorBug: Unexpected errorBug: Unexpected error
Description
| Previous ID | SR-10077 |
| Radar | None |
| Original Reporter | xavier.lowmiller (JIRA User) |
| Type | Bug |
Additional Detail from JIRA
| Votes | 12 |
| Component/s | Compiler |
| Labels | Bug |
| Assignee | @slavapestov |
| Priority | Medium |
md5: 11bc61add2da06bf28b3399dd2617f81
Issue Description:
In Swift 4.2 (Xcode 10.1) and 5.0 (Xcode 10.2 beta 4), it's legal to define multiple identical enum cases as long as their associated value is different:
enum PictureImport { case add(image: UIImage) case add(data: Data) }This, however, leads to compile errors when switching:
func importImage(_ importedImage: PictureImport) { switch importedImage { case .add(image: let image): // Error: Tuple pattern element label 'image' must be 'data' // ... case .add(data: let data): // ... } }(Maybe related to #49402)
hokstuff, KuhlTime, Nobody1707, ohtwo, biasedbit and 2 more
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfdeclarationsFeature: declarationsFeature: declarationsenumFeature → type declarations: Swift enumeration declarationsFeature → type declarations: Swift enumeration declarationsenum casesFeature → enums: Enum casesFeature → enums: Enum casesoverloadingFeature: Overloading symbol namesFeature: Overloading symbol namespattern matchingFeature: pattern matchingFeature: pattern matchingpatternsFeature: patternsFeature: patternsswift 5.9type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysisunexpected errorBug: Unexpected errorBug: Unexpected error