Note [Using coreView in mk_cast_ty]
Invariants (EQ3) and (EQ4) of Note [Respecting definitional equality] in GHC.Core.TyCo.Rep must apply regardless of type synonyms. For instance, consider this example (#19742): type EqSameNat = () |> co useNatEq :: EqSameNat |> sym co (Those casts aren't visible in the user-source code, of course; see #19742 for what the user might write.) The type `EqSameNat |> sym co` looks as if it satisfies (EQ3), as it has no nested casts, but if we expand EqSameNat, we see that it doesn't. And then Bad Things happen. The solution is easy: just use `coreView` when establishing (EQ3) and (EQ4) in `mk_cast_ty`.
References 1
- Respecting definitional equality GHC.Core.TyCo.Rep
Referenced by 1
- GHC.Core.Type call site