swift icon indicating copy to clipboard operation
swift copied to clipboard

Sema: Recognize non-identifier type qualifiers in enum element patterns and type expressions

Open AnthonyLatsis opened this issue 2 years ago • 2 comments

Recognize non-identifier type qualifiers

  • when resolving an enum element pattern. For example, the following switch statements were not considered exhaustive because the parsed expressions resolved to expression patterns:

    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
    }
    
  • in type expressions. Note that simple type expressions, like [X].Element.a, already compiled fine at the time I started working on the associated issue, but were given a suboptimal representation.

Resolves https://github.com/swiftlang/swift/issues/80632

AnthonyLatsis avatar Feb 02 '23 21:02 AnthonyLatsis

@swift-ci please smoke test macOS

AnthonyLatsis avatar Feb 02 '23 21:02 AnthonyLatsis

@xedin ping

AnthonyLatsis avatar Feb 16 '23 18:02 AnthonyLatsis