Be finer-grained when turning on extensions for generated code
authorIan Lynagh <igloo@earth.li>
Tue, 10 Jul 2007 15:24:06 +0000 (15:24 +0000)
committerIan Lynagh <igloo@earth.li>
Tue, 10 Jul 2007 15:24:06 +0000 (15:24 +0000)
compiler/typecheck/TcDeriv.lhs
compiler/typecheck/TcRnDriver.lhs

index fc41c8a..71123d3 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
index 8bb8d3e..8659401 100644 (file)
@@ -695,10 +695,10 @@ tcTopSrcDecls boot_details
        (tc_val_binds,   tcl_env) <- tcTopBinds val_binds ;
        setLclTypeEnv tcl_env   $ do {
 
-               -- Now GHC-generated derived bindings and generics
-               -- Do not generate warnings from compiler-generated code
-       (tc_deriv_binds, tcl_env) <- discardWarnings $ setOptM Opt_GlasgowExts $ 
-                                    tcTopBinds deriv_binds ;
+               -- Now GHC-generated derived bindings and generics.
+               -- Do not generate warnings from compiler-generated code.
+       (tc_deriv_binds, tcl_env) <- discardWarnings $
+                                 tcTopBinds deriv_binds ;
 
                -- Second pass over class and instance declarations, 
         traceTc (text "Tc6") ;