[project @ 1999-05-07 11:31:12 by simonm]
authorsimonm <unknown>
Fri, 7 May 1999 11:31:12 +0000 (11:31 +0000)
committersimonm <unknown>
Fri, 7 May 1999 11:31:12 +0000 (11:31 +0000)
Don't try to make a tag2con function if we're deriving Ix on a
single-constructor datatype (it isn't needed, and will probably be
type-incorrect anyway).

ghc/compiler/typecheck/TcDeriv.lhs

index 9e9a79a..fa51901 100644 (file)
@@ -670,7 +670,8 @@ gen_taggery_Names inst_infos
     do_tag2con acc_Names tycon
       | isDataTyCon tycon &&
          (we_are_deriving enumClassKey tycon ||
-         we_are_deriving ixClassKey   tycon)
+         we_are_deriving ixClassKey   tycon
+         && isEnumerationTyCon tycon)
       = returnTc ( (tag2con_RDR tycon, tycon, GenTag2Con)
                 : (maxtag_RDR  tycon, tycon, GenMaxTag)
                 : acc_Names)