Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/74d401860d6a28244b9a12fca844fe14a6a04274

>---------------------------------------------------------------

commit 74d401860d6a28244b9a12fca844fe14a6a04274
Author: Simon Peyton Jones <simo...@microsoft.com>
Date:   Fri Jan 4 10:30:53 2013 +0000

    Switch on -XEmptyCase when renaming derived declarations
    
    Compiler-generated code can have empty cases

>---------------------------------------------------------------

 compiler/typecheck/TcDeriv.lhs |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/compiler/typecheck/TcDeriv.lhs b/compiler/typecheck/TcDeriv.lhs
index 6eb9ded..10670f7 100644
--- a/compiler/typecheck/TcDeriv.lhs
+++ b/compiler/typecheck/TcDeriv.lhs
@@ -401,7 +401,9 @@ renameDeriv is_boot inst_infos bagBinds
                  , emptyValBindsOut, usesOnly (plusFVs fvs)) }
 
   | otherwise
-  = discardWarnings $    -- Discard warnings about unused bindings etc
+  = discardWarnings $         -- Discard warnings about unused bindings etc
+    setXOptM Opt_EmptyCase $  -- Derived decls (for empty types) can have 
+                              --    case x of {}
     do  {
         -- Bring the extra deriving stuff into scope
         -- before renaming the instances themselves



_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to