Skip to content

Improve pattern to type pattern transformation (#23739)

Andrei Borzenkov requested to merge wip/sand-witch/improve-pat-to-ty into master

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.

Merge request reports