Skip to content
Snippets Groups Projects
Commit cf86f3ec authored by Matthew Craven's avatar Matthew Craven Committed by Vladislav Zavialov
Browse files

Equality of forall-types is visibility aware

This patch finally (I hope) nails the question of whether
   (forall a. ty) and (forall a -> ty)
are `eqType`: they aren't!

There is a long discussion in #22762, plus useful Notes:

* Note [ForAllTy and type equality] in GHC.Core.TyCo.Compare
* Note [Comparing visiblities] in GHC.Core.TyCo.Compare
* Note [ForAllCo] in GHC.Core.TyCo.Rep

It also establishes a helpful new invariant for ForAllCo,
and ForAllTy, when the bound variable is a CoVar:in that
case the visibility must be coreTyLamForAllTyFlag.

All this is well documented in revised Notes.
parent ca1e636a
No related branches found
No related tags found
No related merge requests found
Showing
with 598 additions and 361 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment