From: Ian Lynagh Date: Tue, 10 Jul 2007 15:24:06 +0000 (+0000) Subject: Be finer-grained when turning on extensions for generated code X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=72b5392f4103dc895d569bfad647ddec2de67dec Be finer-grained when turning on extensions for generated code --- diff --git a/compiler/typecheck/TcDeriv.lhs b/compiler/typecheck/TcDeriv.lhs index fc41c8a..71123d3 100644 --- a/compiler/typecheck/TcDeriv.lhs +++ b/compiler/typecheck/TcDeriv.lhs @@ -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 diff --git a/compiler/typecheck/TcRnDriver.lhs b/compiler/typecheck/TcRnDriver.lhs index 8bb8d3e..8659401 100644 --- a/compiler/typecheck/TcRnDriver.lhs +++ b/compiler/typecheck/TcRnDriver.lhs @@ -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") ;