summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Schrijvers <tom.schrijvers@cs.kuleuven.be>2007-09-04 12:39:45 +0000
committerTom Schrijvers <tom.schrijvers@cs.kuleuven.be>2007-09-04 12:39:45 +0000
commitc4b993f3433777eb070de3090d76754cd6b4e2ec (patch)
treea2079e20d7adcf9f9d5c09e8202c9e2b1edcf08b
parent66c58d1c46338135abdb76a86c7342fab005a988 (diff)
downloadhaskell-c4b993f3433777eb070de3090d76754cd6b4e2ec.tar.gz
bug fix in Decomp step of completion algorithm for given equations
-rw-r--r--compiler/typecheck/TcTyFuns.lhs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/typecheck/TcTyFuns.lhs b/compiler/typecheck/TcTyFuns.lhs
index dae7416ff7..0130aa6c4e 100644
--- a/compiler/typecheck/TcTyFuns.lhs
+++ b/compiler/typecheck/TcTyFuns.lhs
@@ -576,7 +576,7 @@ decompInst i@(EqInst {})
do { cotvs <- zipWithM (\t1 t2 ->
newMetaTyVar TauTv
(mkCoKind t1 t2))
- tys1' tys2'
+ tys1 tys2
; let cos = map TyVarTy cotvs
; writeMetaTyVar old_covar (TyConApp con1 cos)
; return $ map mkWantedCo cotvs
@@ -584,9 +584,10 @@ decompInst i@(EqInst {})
-- co_i := Con_i old_co
(\old_co -> return $
map mkGivenCo $
- mkRightCoercions (length tys1') old_co)
- ; insts <- zipWithM mkEqInst (zipWith EqPred tys1' tys2') cos
- ; return (insts, not $ null insts)
+ mkRightCoercions (length tys1) old_co)
+ ; insts <- zipWithM mkEqInst (zipWith EqPred tys1 tys2) cos
+ ; traceTc (text "decomp identicalHead" <+> ppr insts)
+ ; return (insts, not $ null insts)
}
| con1 /= con2 && not (isOpenSynTyCon con1 || isOpenSynTyCon con2)
-- not matching data constructors (of any flavour) are bad news