Commit 8668c549 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Use mkTcEqPred rather than mkEqPred in the type checker

Type.mkEqPred has an assertion warning for kind compatibility.  But
during type checking we may form equality predicates with incompatible
kinds; hence TcType.mkTcEqPred, which does not check.  We were calling
the former instead of the latter in a couple of places, leading to
spurious debug warnings.
parent b95dbb51
......@@ -1262,7 +1262,7 @@ checkKind new_ev s1 k1 s2 k2 -- See Note [Equalities with incompatible kinds]
do { traceTcS "canEqLeaf: incompatible kinds" (vcat [ppr k1, ppr k2])
-- Create a derived kind-equality, and solve it
; mw <- newDerived kind_co_loc (mkEqPred k1 k2)
; mw <- newDerived kind_co_loc (mkTcEqPred k1 k2)
; case mw of
Nothing -> return ()
Just kev -> emitWorkNC [kev]
......
......@@ -793,7 +793,7 @@ misMatchOrCND ctxt ct oriented ty1 ty2
-- or there is no context, don't report the context
= misMatchMsg oriented ty1 ty2
| otherwise
= couldNotDeduce givens ([mkEqPred ty1 ty2], orig)
= couldNotDeduce givens ([mkTcEqPred ty1 ty2], orig)
where
givens = getUserGivens ctxt
orig = TypeEqOrigin { uo_actual = ty1, uo_expected = ty2 }
......
......@@ -1393,7 +1393,7 @@ checkWellStagedDFun pred dfun_id loc
bind_lvl = TcM.topIdLvl dfun_id
pprEq :: TcType -> TcType -> SDoc
pprEq ty1 ty2 = pprType $ mkEqPred ty1 ty2
pprEq ty1 ty2 = pprParendType ty1 <+> char '~' <+> pprParendType ty2
isTouchableMetaTyVarTcS :: TcTyVar -> TcS Bool
isTouchableMetaTyVarTcS tv
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment