From: simonpj Date: Mon, 1 Oct 2001 09:26:27 +0000 (+0000) Subject: [project @ 2001-10-01 09:26:27 by simonpj] X-Git-Tag: Approximately_9120_patches~896 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c605b86323cca9b8c8b5eed6dca715e6b87f9d65;p=ghc-hetmet.git [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.) --- 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