From fd3ceb3c17dcb13f1ab1ca05fb026d9954d5b06c Mon Sep 17 00:00:00 2001 From: sof Date: Fri, 5 Feb 1999 12:35:43 +0000 Subject: [PATCH] [project @ 1999-02-05 12:35:42 by sof] deriving Enum bugfixes --- ghc/compiler/prelude/PrelInfo.lhs | 2 +- ghc/compiler/typecheck/TcGenDeriv.lhs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ghc/compiler/prelude/PrelInfo.lhs b/ghc/compiler/prelude/PrelInfo.lhs index c1e3a9d..f176eed 100644 --- a/ghc/compiler/prelude/PrelInfo.lhs +++ b/ghc/compiler/prelude/PrelInfo.lhs @@ -611,7 +611,7 @@ deriving_occ_info , (ordClassKey, [intTyCon_RDR, compose_RDR, eqTag_RDR]) -- EQ (from Ordering) is needed to force in the constructors -- as well as the type constructor. - , (enumClassKey, [intTyCon_RDR, and_RDR, map_RDR, plus_RDR, showsPrec_RDR, append_RDR]) + , (enumClassKey, [intTyCon_RDR, eq_RDR, ge_RDR, and_RDR, map_RDR, plus_RDR, showsPrec_RDR, append_RDR]) -- The last two Enum deps are only used to produce better -- error msgs for derived toEnum methods. , (boundedClassKey, [intTyCon_RDR]) diff --git a/ghc/compiler/typecheck/TcGenDeriv.lhs b/ghc/compiler/typecheck/TcGenDeriv.lhs index 16d312f..d6ec7f4 100644 --- a/ghc/compiler/typecheck/TcGenDeriv.lhs +++ b/ghc/compiler/typecheck/TcGenDeriv.lhs @@ -512,8 +512,8 @@ gen_Enum_binds tycon (mk_easy_App mkInt_RDR [ah_RDR]) (mk_easy_App mkInt_RDR [bh_RDR]) (HsIf (HsApp (HsApp (HsVar gt_RDR) - (HsVar a_RDR)) - (HsVar b_RDR)) + (mk_easy_App mkInt_RDR [ah_RDR])) + (mk_easy_App mkInt_RDR [bh_RDR])) (HsLit (HsInt 0)) (HsVar (maxtag_RDR tycon)) tycon_loc)) -- 1.7.10.4