Skip to content

Cannot resolve enum element pattern with sugared type qualifier #80632

@AnthonyLatsis

Description

@AnthonyLatsis

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

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfpatternsFeature: patternssugared typesFeature: sugared types, e.g. 'Int?' or '[Int]'swift 6.2type checkerArea → compiler: Semantic analysistypesFeature: typesunexpected errorBug: Unexpected error

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions