Skip to content

Use bidirectional typechecking for type patterns (#23639)

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

This patch allows us to bind type variables in patterns with polymorphic kinds.

It introduces TcTypeM monad, that holds all the stuff required to bind type patterns deeply inside type kind checking See Note [TcTypeM and Type Patterns] for the details.

The main change touches tcTyVar: here we add additional examination for names, that aren't currently in the scope, but may be binders in type patterns.

All other changes are just accommodation of TcTypeM in the tcHsType function.

Merge request reports