X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcTyClsDecls.lhs;h=89afedfda8ea757cf3f95eadc40de2bea19bac76;hb=19b44dcc5e5b9f92735fa99aa45dfaa94777177c;hp=3880f1f956e7b7bd9bbaf037679fc4d87b816891;hpb=0ed91c9c2e3e252af15b6dd69e3f682aebaad118;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcTyClsDecls.lhs b/compiler/typecheck/TcTyClsDecls.lhs index 3880f1f..89afedf 100644 --- a/compiler/typecheck/TcTyClsDecls.lhs +++ b/compiler/typecheck/TcTyClsDecls.lhs @@ -1054,6 +1054,9 @@ checkValidDataCon tc con addErrCtxt (dataConCtxt con) $ do { checkTc (dataConTyCon con == tc) (badDataConTyCon con) ; checkValidType ctxt (dataConUserType con) + ; checkValidMonoType (dataConOrigResTy con) + -- Disallow MkT :: T (forall a. a->a) + -- Reason: it's really the argument of an equality constraint ; ifM (isNewTyCon tc) (checkNewDataCon con) } where @@ -1214,7 +1217,7 @@ badGadtDecl tc_name badExistential con_name = hang (ptext SLIT("Data constructor") <+> quotes (ppr con_name) <+> - ptext SLIT("has existential type variables, or a context, or both")) + ptext SLIT("has existential type variables, or a context")) 2 (parens $ ptext SLIT("Use -XExistentialQuantification or -XGADTs to allow this")) badStupidTheta tc_name