Skip to content
  • Andrei Borzenkov's avatar
    Improve pattern to type pattern transformation (23739) · 2c0f8ddb
    Andrei Borzenkov authored and Marge Bot's avatar Marge Bot committed
    `pat_to_type_pat` function now can handle more patterns:
      - TuplePat
      - ListPat
      - LitPat
      - NPat
      - ConPat
    
    Allowing these new constructors in type patterns significantly
    increases possible shapes of type patterns without `type` keyword.
    
    This patch also changes how lookups in `lookupOccRnConstr` are
    performed, because we need to fall back into
    types when we didn't find a constructor on data level to perform
    `ConPat` to type transformation properly.
    2c0f8ddb