Improve error message (part of Trac #1606)
[ghc-hetmet.git] / compiler / typecheck / TcDeriv.lhs
index 0272c54..0acf31c 100644 (file)
@@ -238,10 +238,11 @@ tcDeriving tycl_decls inst_decls deriv_decls
        ; gen_binds <- mkGenericBinds tycl_decls
 
        -- Rename these extra bindings, discarding warnings about unused bindings etc
-       -- Set -fglasgow exts so that we can have type signatures in patterns,
-       -- which is used in the generic binds
+       -- Type signatures in patterns are used in the generic binds
        ; rn_binds
-               <- discardWarnings $ setOptM Opt_GlasgowExts $ do
+               <- discardWarnings $
+           setOptM Opt_PatternSignatures $
+           do
                        { (rn_deriv, _dus1) <- rnTopBinds (ValBindsIn deriv_binds [])
                        ; (rn_gen, dus_gen) <- rnTopBinds (ValBindsIn gen_binds   [])
                        ; keepAliveSetTc (duDefs dus_gen)       -- Mark these guys to
@@ -408,7 +409,7 @@ mkEqnHelp orig tvs cls cls_tys tc_app
                
        ; (rep_tc, rep_tc_args) <- tcLookupFamInstExact tycon full_tc_args
 
-       ; mayDeriveDataTypeable <- doptM Opt_GlasgowExts
+       ; mayDeriveDataTypeable <- doptM Opt_DeriveDataTypeable
        ; newtype_deriving <- doptM Opt_GeneralizedNewtypeDeriving
        ; overlap_flag <- getOverlapFlag
 
@@ -656,7 +657,7 @@ mkNewTypeEqn orig mayDeriveDataTypeable newtype_deriving overlap_flag tvs cls cl
        mb_std_err = checkSideConditions mayDeriveDataTypeable cls cls_tys rep_tycon
        std_err = derivingThingErr cls cls_tys tc_app $
                  vcat [fromJust mb_std_err,
-                       ptext SLIT("Try -fglasgow-exts for GHC's newtype-deriving extension")]
+                       ptext SLIT("Try -XGeneralizedNewtypeDeriving for GHC's newtype-deriving extension")]
 
        -- Here is the plan for newtype derivings.  We see
        --        newtype T a1...an = MkT (t ak+1...an) deriving (.., C s1 .. sm, ...)