X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcMType.lhs;h=02de94079a5f36cec98836bae532c0fb2005e5f9;hb=45b7ef25fe0bdab56b817d17f24db0e725cc7688;hp=1addfe4f1be1ef04013beb04787c57f1bd0eec52;hpb=f16dbbbe59cf3aa19c5fd384560a1b89076d7bc8;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcMType.lhs b/compiler/typecheck/TcMType.lhs index 1addfe4..02de940 100644 --- a/compiler/typecheck/TcMType.lhs +++ b/compiler/typecheck/TcMType.lhs @@ -524,6 +524,7 @@ writeMetaTyVar tyvar ty -- TOM: It should also work for coercions -- ASSERT2( k2 `isSubKind` k1, (ppr tyvar <+> ppr k1) $$ (ppr ty <+> ppr k2) ) do { ASSERTM2( do { details <- readMetaTyVar tyvar; return (isFlexi details) }, ppr tyvar ) + ; traceTc (text "writeMetaTyVar" <+> ppr tyvar <+> text ":=" <+> ppr ty) ; writeMutVar (metaTvRef tyvar) (Indirect ty) } where _k1 = tyVarKind tyvar @@ -997,18 +998,22 @@ checkValidType ctxt ty = do | otherwise = Rank n rank = case ctxt of - GenPatCtxt -> MustBeMonoType DefaultDeclCtxt-> MustBeMonoType ResSigCtxt -> MustBeMonoType LamPatSigCtxt -> gen_rank 0 BindPatSigCtxt -> gen_rank 0 TySynCtxt _ -> gen_rank 0 + GenPatCtxt -> gen_rank 1 + -- This one is a bit of a hack + -- See the forall-wrapping in TcClassDcl.mkGenericInstance + ExprSigCtxt -> gen_rank 1 FunSigCtxt _ -> gen_rank 1 ConArgCtxt _ | polycomp -> gen_rank 2 -- We are given the type of the entire -- constructor, hence rank 1 | otherwise -> gen_rank 1 + ForSigCtxt _ -> gen_rank 1 SpecInstCtxt -> gen_rank 1