[project @ 2001-05-09 13:28:11 by simonpj]
authorsimonpj <unknown>
Wed, 9 May 2001 13:28:11 +0000 (13:28 +0000)
committersimonpj <unknown>
Wed, 9 May 2001 13:28:11 +0000 (13:28 +0000)
commitf11dacd86848fa7bbe5a9e38bf07b85432aa3546
tree784229ad0d32d671c674509ce0739eb1771d6ff9
parent43f425a47a7dc19bd4284112548ab51d230a0482
[project @ 2001-05-09 13:28:11 by simonpj]
**** MERGE WITH 5.00 BRANCH     ********

-------------------------------
Fix a rather obscure rule bogon
-------------------------------

The problem was that there was

class Foo a where
  op :: a -> a

{-# RULES "op" op x = x #-}

or something like that.  We attach locally defined rules, like this one,
to the local binding, in SimplCore.prepareRules.  Alas op doesn't reply
"True" to isLocalId, because it's a class selector (so it's a GlobalId
throughout).   Result: we treated the rule as an imported rule, and
therefore gave 'op' a fresh unique (becuase it looked as if it was
already in scope).  This only blew up in ghc --make or --interactive.

The handling of local vs global rules is rather unsatisfactory.
Something to muse on.
ghc/compiler/simplCore/SimplCore.lhs