[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.