[commit: ghc] master: Fix #7487 (31d8900)

José Pedro Magalhães <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/31d8900dbcf87fc32ac9e3de2ea0ed2039e72ee4

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

commit 31d8900dbcf87fc32ac9e3de2ea0ed2039e72ee4
Author: Jose Pedro Magalhaes <[email protected]>
Date:   Fri Dec 7 16:24:06 2012 +0000

    Fix #7487
    
    Signed-off-by: Jose Pedro Magalhaes <[email protected]>

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

 compiler/typecheck/TcGenGenerics.lhs |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/compiler/typecheck/TcGenGenerics.lhs b/compiler/typecheck/TcGenGenerics.lhs
index d1746fe..0109a99 100644
--- a/compiler/typecheck/TcGenGenerics.lhs
+++ b/compiler/typecheck/TcGenGenerics.lhs
@@ -324,17 +324,15 @@ canDoGenerics1_w rep_tc
     representable ty = case tcSplitTyConApp_maybe ty of
       Nothing -> return Nothing
       -- if it's a type constructor, it has to be representable
-      Just (tc, tc_args) -> do
+      Just (tc, _) -> do
         let n = tyConName tc
         s <- S.get
         -- internally assume that recursive occurrences are OK
         if n `elem` s then return Nothing else do
           S.put (n : s)
-          fmap {-maybe-} (\_ -> bad_app tc) -- don't give the message, just name what wasn't representable
-            `fmap` {-state-} case canDoGenerics tc tc_args of
-              j@(Just _) -> return j
-              -- only check Generic1 if it passes Generic
-              Nothing -> canDoGenerics1_w tc
+          fmap {-maybe-} (\_ -> bad_app tc) -- don't give the message, just
+                                            -- name what wasn't representable
+            `fmap` {-state-} canDoGenerics1_w tc
 
     existential = (ptext . sLit) "must not have existential arguments"
     covariant   = (ptext . sLit) "must not use the last type parameter in a function argument"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.