[commit: ghc] master: A bit more tc-tracking in TcUnify.uUnfilledVar (7a2b5d0)
git at git.haskell.org
git at git.haskell.org
Tue Jun 26 11:09:56 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/7a2b5d0c97da71f5e5a7d82b28e8a734b0ff95df/ghc
>---------------------------------------------------------------
commit 7a2b5d0c97da71f5e5a7d82b28e8a734b0ff95df
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Tue Jun 26 12:07:08 2018 +0100
A bit more tc-tracking in TcUnify.uUnfilledVar
>---------------------------------------------------------------
7a2b5d0c97da71f5e5a7d82b28e8a734b0ff95df
compiler/typecheck/TcUnify.hs | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/compiler/typecheck/TcUnify.hs b/compiler/typecheck/TcUnify.hs
index fa845bb..9b32c3c 100644
--- a/compiler/typecheck/TcUnify.hs
+++ b/compiler/typecheck/TcUnify.hs
@@ -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)
More information about the ghc-commits
mailing list