Skip to content

Use HsForAllTelescope to avoid inferred, visible foralls

Ryan Scott requested to merge wip/T18235 into master

Currently, HsForAllTy permits the combination of ForallVis and Inferred, but you can't actually typecheck code that uses it (e.g., forall {a} ->). This patch refactors HsForAllTy to use a new HsForAllTelescope data type that makes a type-level distinction between visible and invisible foralls such that visible foralls do not track Specificity. That part of the patch is actually quite small; the rest is simply changing consumers of HsType to accommodate this new type.

Fixes #18235 (closed).

Merge request reports