X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcDeriv.lhs;h=e2ddc9d9c7d3d102b117a046d03642d02556df54;hp=86194c0cb0dab2a2db6f9e51b6b7bf9166775a57;hb=a6f2d598e1e7760d334d1b5ea0b7745e66835e11;hpb=896135d0231f798f264548f5935223d142e718a7 diff --git a/compiler/typecheck/TcDeriv.lhs b/compiler/typecheck/TcDeriv.lhs index 86194c0..e2ddc9d 100644 --- a/compiler/typecheck/TcDeriv.lhs +++ b/compiler/typecheck/TcDeriv.lhs @@ -928,7 +928,7 @@ cond_functorOK :: Bool -> Condition -- (d) optionally: don't use function types -- (e) no "stupid context" on data type cond_functorOK allowFunctions (dflags, rep_tc) - | not (dopt Opt_DeriveFunctor dflags) + | not (xopt Opt_DeriveFunctor dflags) = Just (ptext (sLit "You need -XDeriveFunctor to derive an instance for this class")) | null tc_tvs @@ -971,7 +971,7 @@ cond_functorOK allowFunctions (dflags, rep_tc) checkFlag :: ExtensionFlag -> Condition checkFlag flag (dflags, _) - | dopt flag dflags = Nothing + | xopt flag dflags = Nothing | otherwise = Just why where why = ptext (sLit "You need -X") <> text flag_str @@ -1074,7 +1074,7 @@ mkNewTypeEqn orig dflags tvs | can_derive_via_isomorphism -> bale_out (non_std $$ suggest_nd) -- Try newtype deriving! | otherwise -> bale_out non_std where - newtype_deriving = dopt Opt_GeneralizedNewtypeDeriving dflags + newtype_deriving = xopt Opt_GeneralizedNewtypeDeriving dflags go_for_it = mk_data_eqn orig tvs cls tycon tc_args rep_tycon rep_tc_args mtheta bale_out msg = failWithTc (derivingThingErr newtype_deriving cls cls_tys inst_ty msg)