From c605b86323cca9b8c8b5eed6dca715e6b87f9d65 Mon Sep 17 00:00:00 2001 From: simonpj Date: Mon, 1 Oct 2001 09:26:27 +0000 Subject: [PATCH] [project @ 2001-10-01 09:26:27 by simonpj] Fix a long-standing lossage of rules attached to class operations (A one-line fix to SimplCore.updateBinders.) --- ghc/compiler/simplCore/SimplCore.lhs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ghc/compiler/simplCore/SimplCore.lhs b/ghc/compiler/simplCore/SimplCore.lhs index 7d3c04a..5ed34a4 100644 --- a/ghc/compiler/simplCore/SimplCore.lhs +++ b/ghc/compiler/simplCore/SimplCore.lhs @@ -282,9 +282,12 @@ updateBinders rule_ids rule_rhs_fvs is_exported binds update_bndrs (Rec prs) = Rec [(update_bndr b, r) | (b,r) <- prs] update_bndr bndr - | isImplicitId bndr = bndr -- Constructors, selectors; doesn't - -- make sense to call setIdLocalExported - -- Also can't have rules + | isImplicitId bndr = bndr_with_rules + -- Constructors, selectors; doesn't + -- make sense to call setIdLocalExported + -- They can have rules, though; e.g. + -- class Foo a where { op :: a->a } + -- {-# RULES op x = y #-} | dont_discard bndr = setIdLocalExported bndr_with_rules | otherwise = bndr_with_rules where -- 1.7.10.4