X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FUnify.lhs;h=77742f4db54fd893b98e9abd06377146b95aabb7;hb=e7498a3ee1d0484d02a9e86633cc179c76ebf36e;hp=ad979b77349cd0f4c68326c7aeffbf99cf75fde5;hpb=f01a8e8c9c53bfb5ab3393ed3457ebf25390efa1;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/Unify.lhs b/ghc/compiler/typecheck/Unify.lhs index ad979b7..77742f4 100644 --- a/ghc/compiler/typecheck/Unify.lhs +++ b/ghc/compiler/typecheck/Unify.lhs @@ -11,10 +11,10 @@ updatable substitution). module Unify ( unifyTauTy, unifyTauTyList, unifyTauTyLists, unifyFunTy ) where -import Ubiq +IMP_Ubiq() -- friends: -import TcMonad +import TcMonad hiding ( rnMtoTcM ) import Type ( GenType(..), typeKind, mkFunTy, getFunTy_maybe ) import TyCon ( TyCon, mkFunTyCon ) import TyVar ( GenTyVar(..), TyVar(..), tyVarKind ) @@ -229,15 +229,24 @@ uUnboundVar tv1@(TyVar uniq1 kind1 name1 box1) case (maybe_ty1, maybe_ty2) of (_, BoundTo ty2') -> uUnboundVar tv1 maybe_ty1 ty2' ty2' - (DontBind,DontBind) - -> failTc (unifyDontBindErr tv1 ps_ty2) - (UnBound, _) | kind2 `hasMoreBoxityInfo` kind1 -> tcWriteTyVar tv1 ty2 `thenNF_Tc_` returnTc () (_, UnBound) | kind1 `hasMoreBoxityInfo` kind2 -> tcWriteTyVar tv2 (TyVarTy tv1) `thenNF_Tc_` returnTc () +-- TEMPORARY FIX +-- (DontBind,DontBind) +-- -> failTc (unifyDontBindErr tv1 ps_ty2) + +-- TEMPORARILY allow two type-sig variables to be bound together. +-- See notes in tcCheckSigVars + (DontBind,DontBind) | kind2 `hasMoreBoxityInfo` kind1 + -> tcWriteTyVar tv1 ty2 `thenNF_Tc_` returnTc () + + | kind1 `hasMoreBoxityInfo` kind2 + -> tcWriteTyVar tv2 (TyVarTy tv1) `thenNF_Tc_` returnTc () + other -> failTc (unifyKindErr tv1 ps_ty2) -- Second one isn't a type variable @@ -330,9 +339,9 @@ expectedFunErr ty sty unifyKindErr tyvar ty sty = ppHang (ppStr "Compiler bug: kind mis-match between") - 4 (ppSep [ppr sty tyvar, ppLparen, ppr sty (tyVarKind tyvar), ppRparen, + 4 (ppSep [ppCat [ppr sty tyvar, ppStr "::", ppr sty (tyVarKind tyvar)], ppStr "and", - ppr sty ty, ppLparen, ppr sty (typeKind ty), ppRparen]) + ppCat [ppr sty ty, ppStr "::", ppr sty (typeKind ty)]]) unifyDontBindErr tyvar ty sty = ppHang (ppStr "Couldn't match the *signature/existential* type variable")