X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcTyFuns.lhs;h=0130aa6c4ebd984cff9d64ebfb7e48f10a2179ea;hb=eeb635d0ed2346568e312ac06ce7f2f1ecb434be;hp=b5ceb78abb139fcb8b08a78ace7c74f7ad6fbd2c;hpb=17b297d97d327620ed6bfab942f8992b2446f1bf;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcTyFuns.lhs b/compiler/typecheck/TcTyFuns.lhs index b5ceb78..0130aa6 100644 --- a/compiler/typecheck/TcTyFuns.lhs +++ b/compiler/typecheck/TcTyFuns.lhs @@ -1,10 +1,10 @@ \begin{code} -{-# OPTIONS_GHC -w #-} +{-# OPTIONS -w #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and fix -- any warnings in the module. See --- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings -- for details module TcTyFuns( @@ -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,17 +584,19 @@ 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 = do { env0 <- tcInitTidyEnv - ; let (env1, tidy_ty1) = tidyOpenType env0 ty1 - (env2, tidy_ty2) = tidyOpenType env1 ty2 - extra = sep [ppr tidy_ty1, char '~', ppr tidy_ty2] - msg = ptext SLIT("Couldn't match expected type against inferred type") + ; let (env1, tidy_ty1) = tidyOpenType env0 ty1 + (env2, tidy_ty2) = tidyOpenType env1 ty2 + extra = sep [ppr tidy_ty1, char '~', ppr tidy_ty2] + msg = + ptext SLIT("Unsolvable equality constraint:") ; failWithTcM (env2, hang msg 2 extra) } where