Skip to content

Kind equality should be part of `checkEqType`

The function GHC.Tc.Utils.checkEqType checks the invariants demanded of a canonical equality constraint, and reports which ones do not hold. Alas, it omits one very important one: checking that

   typeKind t1 `eqType` typeKind t2

This ticket is to propose that we move that test into checkEqType.

In the call from GHC.Tc.Utils.Unify that would be a nice improvement. But in GHC.Tc.Solver.Canonical we check for the kind-inhomogenity` rather early, and it's not immediately obvious to me how to refactor. And yet it would clearly be a Good Thing to do so.

@rae: any opinions?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information