[commit: ghc] wip/orf-reboot: Fix silly bug in ifaceConDeclFields for empty data types (2346399)

git at git.haskell.org git at git.haskell.org
Tue Jul 7 15:19:44 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/orf-reboot
Link       : http://ghc.haskell.org/trac/ghc/changeset/23463995005a57e560ac55c9c749cf11bbd9feab/ghc

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

commit 23463995005a57e560ac55c9c749cf11bbd9feab
Author: Adam Gundry <adam at well-typed.com>
Date:   Wed Jul 1 16:58:33 2015 +0100

    Fix silly bug in ifaceConDeclFields for empty data types


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

23463995005a57e560ac55c9c749cf11bbd9feab
 compiler/iface/IfaceSyn.hs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/compiler/iface/IfaceSyn.hs b/compiler/iface/IfaceSyn.hs
index 7fcabaa..4b7a311 100644
--- a/compiler/iface/IfaceSyn.hs
+++ b/compiler/iface/IfaceSyn.hs
@@ -332,13 +332,13 @@ visibleIfConDecls (IfNewTyCon c   _ _) = [c]
 
 ifaceConDeclFields :: IfaceConDecls -> [FieldLbl OccName]
 ifaceConDeclFields x = case x of
-    IfAbstractTyCon {}                    -> []
-    IfDataFamTyCon  {}                    -> []
-    IfDataTyCon cons is_overloaded labels -> help cons  is_overloaded labels
-    IfNewTyCon  con  is_overloaded labels -> help [con] is_overloaded labels
+    IfAbstractTyCon {}              -> []
+    IfDataFamTyCon  {}              -> []
+    IfDataTyCon cons is_over labels -> map (help cons  is_over) labels
+    IfNewTyCon  con  is_over labels -> map (help [con] is_over) labels
   where
-    help (dc:_) is_overloaded = map (\ lbl -> mkFieldLabelOccs lbl (ifConOcc dc) is_overloaded)
-    help [] _ = error "ifaceConDeclFields: data type has no constructors!"
+    help (dc:_) is_over lbl = mkFieldLabelOccs lbl (ifConOcc dc) is_over
+    help [] _ _ = error "ifaceConDeclFields: data type has no constructors!"
 
 ifaceDeclImplicitBndrs :: IfaceDecl -> [OccName]
 --  *Excludes* the 'main' name, but *includes* the implicitly-bound names



More information about the ghc-commits mailing list