import UniqSupply
import SrcLoc
import Outputable
+import FastString
import Control.Monad ( when, unless )
import Data.List ( (\\) )
| 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
where
k1 = tyVarKind tyvar
k2 = typeKind ty
-#endif
\end{code}
; 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]