X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcTyClsDecls.lhs;h=393f4ff484c73715901ff63eb8431702111ef8d1;hb=0430775a77e219740b66bf4f1db82d7596fa6744;hp=6a6304f2201483655e513f287644e446746a843e;hpb=d2ce0f52d42edf32bb9f13796e6ba6edba8bd516;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcTyClsDecls.lhs b/compiler/typecheck/TcTyClsDecls.lhs index 6a6304f..393f4ff 100644 --- a/compiler/typecheck/TcTyClsDecls.lhs +++ b/compiler/typecheck/TcTyClsDecls.lhs @@ -30,7 +30,8 @@ import Class import TyCon import DataCon import Id -import MkId ( rEC_SEL_ERROR_ID, mkDefaultMethodId ) +import MkId ( mkDefaultMethodId ) +import MkCore ( rEC_SEL_ERROR_ID ) import IdInfo import Var import VarSet @@ -255,7 +256,7 @@ tcFamInstDecl top_lvl (L loc decl) tcAddDeclCtxt decl $ do { -- type family instances require -XTypeFamilies -- and can't (currently) be in an hs-boot file - ; type_families <- doptM Opt_TypeFamilies + ; type_families <- xoptM Opt_TypeFamilies ; is_boot <- tcIsHsBoot -- Are we compiling an hs-boot file? ; checkTc type_families $ badFamInstDecl (tcdLName decl) ; checkTc (not is_boot) $ badBootFamInstDeclErr @@ -349,7 +350,7 @@ tcFamInstDecl1 (decl@TyData {tcdND = new_or_data, tcdLName = L loc tc_name, ; mapM_ checkTyFamFreeness t_typats -- Check that we don't use GADT syntax in H98 world - ; gadt_ok <- doptM Opt_GADTs + ; gadt_ok <- xoptM Opt_GADTs ; checkTc (gadt_ok || consUseH98Syntax cons) (badGadtDecl tc_name) -- (b) a newtype has exactly one constructor @@ -710,7 +711,7 @@ tcTyClDecl1 parent _calc_isrec { traceTc "type family:" (ppr tc_name) -- Check that we don't use families without -XTypeFamilies - ; idx_tys <- doptM Opt_TypeFamilies + ; idx_tys <- xoptM Opt_TypeFamilies ; checkTc idx_tys $ badFamInstDecl tc_name ; tycon <- buildSynTyCon tc_name tvs' SynFamilyTyCon kind parent Nothing @@ -728,7 +729,7 @@ tcTyClDecl1 parent _calc_isrec -- Check that we don't use families without -XTypeFamilies - ; idx_tys <- doptM Opt_TypeFamilies + ; idx_tys <- xoptM Opt_TypeFamilies ; checkTc idx_tys $ badFamInstDecl tc_name ; tycon <- buildAlgTyCon tc_name final_tvs [] @@ -746,12 +747,12 @@ tcTyClDecl1 parent calc_isrec { extra_tvs <- tcDataKindSig mb_ksig ; let final_tvs = tvs' ++ extra_tvs ; stupid_theta <- tcHsKindedContext ctxt - ; want_generic <- doptM Opt_Generics + ; want_generic <- xoptM Opt_Generics ; unbox_strict <- doptM Opt_UnboxStrictFields - ; empty_data_decls <- doptM Opt_EmptyDataDecls - ; kind_signatures <- doptM Opt_KindSignatures - ; existential_ok <- doptM Opt_ExistentialQuantification - ; gadt_ok <- doptM Opt_GADTs + ; empty_data_decls <- xoptM Opt_EmptyDataDecls + ; kind_signatures <- xoptM Opt_KindSignatures + ; existential_ok <- xoptM Opt_ExistentialQuantification + ; gadt_ok <- xoptM Opt_GADTs ; is_boot <- tcIsHsBoot -- Are we compiling an hs-boot file? ; let ex_ok = existential_ok || gadt_ok -- Data cons can have existential context @@ -1179,9 +1180,9 @@ checkNewDataCon con ------------------------------- checkValidClass :: Class -> TcM () checkValidClass cls - = do { constrained_class_methods <- doptM Opt_ConstrainedClassMethods - ; multi_param_type_classes <- doptM Opt_MultiParamTypeClasses - ; fundep_classes <- doptM Opt_FunctionalDependencies + = do { constrained_class_methods <- xoptM Opt_ConstrainedClassMethods + ; multi_param_type_classes <- xoptM Opt_MultiParamTypeClasses + ; fundep_classes <- xoptM Opt_FunctionalDependencies -- Check that the class is unary, unless GlaExs ; checkTc (notNull tyvars) (nullaryClassErr cls)