-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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 itselfpatternsFeature: patternsFeature: patternssugared typesFeature: sugared types, e.g. 'Int?' or '[Int]'Feature: sugared types, e.g. 'Int?' or '[Int]'swift 6.2type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistypesFeature: typesFeature: typesunexpected errorBug: Unexpected errorBug: Unexpected error
Description
Description
Below, neither of the switches are considered exhaustive because the patterns are evaluated as expressions rather than enum elements.
Reproduction
enum E { case a }
let e: E
switch e {
case [E].Element.a: break
}
switch Int?.none {
case Int?.none: break
case Int?.some(_): break
}
Expected behavior
Successful compilation.
Environment
Swift version 6.2-dev (LLVM 3374ec7e774383d, Swift c5e5311)
Additional information
No response
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 itselfpatternsFeature: patternsFeature: patternssugared typesFeature: sugared types, e.g. 'Int?' or '[Int]'Feature: sugared types, e.g. 'Int?' or '[Int]'swift 6.2type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistypesFeature: typesFeature: typesunexpected errorBug: Unexpected errorBug: Unexpected error