Commit 7a2b5d0c authored by Simon Peyton Jones's avatar Simon Peyton Jones

A bit more tc-tracking in TcUnify.uUnfilledVar

parent 261dd83c
......@@ -1571,19 +1571,25 @@ uUnfilledVar2 origin t_or_k swapped tv1 ty2
| canSolveByUnification cur_lvl tv1 ty2
, Just ty2' <- metaTyVarUpdateOK dflags tv1 ty2
= do { co_k <- uType KindLevel kind_origin (typeKind ty2') (tyVarKind tv1)
; traceTc "uUnfilledVar2 ok" $
vcat [ ppr tv1 <+> dcolon <+> ppr (tyVarKind tv1)
, ppr ty2 <+> dcolon <+> ppr (typeKind ty2)
, ppr (isTcReflCo co_k), ppr co_k ]
; if isTcReflCo co_k -- only proceed if the kinds matched.
then do { writeMetaTyVar tv1 ty2'
; return (mkTcNomReflCo ty2') }
else defer } -- this cannot be solved now.
-- See Note [Equalities with incompatible kinds]
-- in TcCanonical
else defer } -- This cannot be solved now. See TcCanonical
-- Note [Equalities with incompatible kinds]
| otherwise
= defer
= do { traceTc "uUnfilledVar2 not ok" (ppr tv1 $$ ppr ty2)
-- Occurs check or an untouchable: just defer
-- NB: occurs check isn't necessarily fatal:
-- eg tv1 occured in type family parameter
; defer }
ty1 = mkTyVarTy tv1
kind_origin = KindEqOrigin ty1 (Just ty2) origin (Just t_or_k)
......
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