Note [Decomposing FunTy]
can_eq_nc' may attempt to decompose a FunTy that is un-zonked. This
means that we may very well have a FunTy containing a type of some
unknown kind. For instance, we may have,
FunTy (a :: k) Int
Where k is a unification variable. So the calls to splitRuntimeRep_maybe may
fail (returning Nothing). In that case we'll fall through, zonk, and try again.
Zonking should fill the variable k, meaning that decomposition will succeed the
second time around.
Also note that we require the FunTyFlag to match. This will stop
us decomposing
(Int -> Bool) ~ (Show a => blah)
It's as if we treat (->) and (=>) as different type constructors, which
indeed they are! References 0
This Note does not link to any other.
Referenced by 4
- GHC.Core.Type call site
- The Purely Kinded Type Invariant (PKTI) GHC.Tc.Gen.HsType
- GHC.Tc.Solver.Equality call site
- GHC.Tc.Solver.Rewrite call site