Note [Deferred errors for coercion holes]
Suppose we need to defer a type error where the destination for the evidence
is a coercion hole. We can't just put the error in the hole, because we can't
make an erroneous coercion. (Remember that coercions are erased for runtime.)
Instead, we invent a new EvVar, bind it to an error and then make a coercion
from that EvVar, filling the hole with that coercion. Because coercions'
types are unlifted, the error is guaranteed to be hit before we get to the
coercion.
************************************************************************
* *
Irreducible predicate errors
* *
************************************************************************ References 0
This Note does not link to any other.
Referenced by 3
- The equality types story GHC.Builtin.Types.Prim
- GHC.Tc.Errors call site
- When to build an implication GHC.Tc.Utils.Unify