X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcMType.lhs;h=b9db015e1dafc4ad612848a0aa4289e6e798f0b5;hb=55e0ee453646be887a27a3fe6b4559d8182bf9fe;hp=4cd966f2e74e2260a0c5aab944dc8d3aa7c3d291;hpb=467f588c25e6d7825a11eff018a67727b3dea71b;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcMType.lhs b/compiler/typecheck/TcMType.lhs index 4cd966f..b9db015 100644 --- a/compiler/typecheck/TcMType.lhs +++ b/compiler/typecheck/TcMType.lhs @@ -88,6 +88,7 @@ import ListSetOps import UniqSupply import SrcLoc import Outputable +import FastString import Control.Monad ( when, unless ) import Data.List ( (\\) ) @@ -506,14 +507,12 @@ isFilledMetaTyVar tv | otherwise = return False writeMetaTyVar :: TcTyVar -> TcType -> TcM () -#ifndef DEBUG -writeMetaTyVar tyvar ty = writeMutVar (metaTvRef tyvar) (Indirect ty) -#else +writeMetaTyVar tyvar ty + | not debugIsOn = writeMutVar (metaTvRef tyvar) (Indirect ty) writeMetaTyVar tyvar ty | not (isMetaTyVar tyvar) = pprTrace "writeMetaTyVar" (ppr tyvar) $ return () - | otherwise = ASSERT( isMetaTyVar tyvar ) -- TOM: It should also work for coercions @@ -523,7 +522,6 @@ writeMetaTyVar tyvar ty where k1 = tyVarKind tyvar k2 = typeKind ty -#endif \end{code} @@ -1181,10 +1179,10 @@ check_arg_type rank ty ; checkTc (not (isUnLiftedType ty)) (unliftedArgErr ty) } ---------------------------------------- -forAllTyErr ty = ptext SLIT("Illegal polymorphic or qualified type:") <+> ppr ty -unliftedArgErr ty = ptext SLIT("Illegal unlifted type:") <+> ppr ty -ubxArgTyErr ty = ptext SLIT("Illegal unboxed tuple type as function argument:") <+> ppr ty -kindErr kind = ptext SLIT("Expecting an ordinary type, but found a type of kind") <+> ppr kind +forAllTyErr ty = sep [ptext SLIT("Illegal polymorphic or qualified type:"), ppr ty] +unliftedArgErr ty = sep [ptext SLIT("Illegal unlifted type:"), ppr ty] +ubxArgTyErr ty = sep [ptext SLIT("Illegal unboxed tuple type as function argument:"), ppr ty] +kindErr kind = sep [ptext SLIT("Expecting an ordinary type, but found a type of kind"), ppr kind] \end{code} Note [Liberal type synonyms]