; want_generic <- doptM Opt_Generics
; unbox_strict <- doptM Opt_UnboxStrictFields
; gla_exts <- doptM Opt_GlasgowExts
; want_generic <- doptM Opt_Generics
; unbox_strict <- doptM Opt_UnboxStrictFields
; gla_exts <- doptM Opt_GlasgowExts
; is_boot <- tcIsHsBoot -- Are we compiling an hs-boot file?
-- Check that we don't use GADT syntax in H98 world
; is_boot <- tcIsHsBoot -- Are we compiling an hs-boot file?
-- Check that we don't use GADT syntax in H98 world
-- Check that we don't use kind signatures without Glasgow extensions
; checkTc (gla_exts || isNothing mb_ksig) (badSigTyDecl tc_name)
-- Check that we don't use kind signatures without Glasgow extensions
; checkTc (gla_exts || isNothing mb_ksig) (badSigTyDecl tc_name)
}
where
(_univ_tvs, ex_tvs, eq_spec, theta, arg_tys, _res_ty) = dataConFullSig con
}
where
(_univ_tvs, ex_tvs, eq_spec, theta, arg_tys, _res_ty) = dataConFullSig con
= sep [ptext SLIT("A newtype constructor cannot have an existential context,"),
nest 2 $ ptext SLIT("but") <+> quotes (ppr con) <+> ptext SLIT("does")]
= sep [ptext SLIT("A newtype constructor cannot have an existential context,"),
nest 2 $ ptext SLIT("but") <+> quotes (ppr con) <+> ptext SLIT("does")]
newtypePredError con
= sep [ptext SLIT("A newtype constructor must have a return type of form T a1 ... an"),
nest 2 $ ptext SLIT("but") <+> quotes (ppr con) <+> ptext SLIT("does not")]
newtypePredError con
= sep [ptext SLIT("A newtype constructor must have a return type of form T a1 ... an"),
nest 2 $ ptext SLIT("but") <+> quotes (ppr con) <+> ptext SLIT("does not")]