Monadify specialise/Specialise: use do, return, standard monad functions and MonadUnique
[ghc-hetmet.git] / compiler / typecheck / TcTyClsDecls.lhs
index 3880f1f..89afedf 100644 (file)
@@ -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