[project @ 2001-05-14 12:03:41 by simonpj]
authorsimonpj <unknown>
Mon, 14 May 2001 12:03:41 +0000 (12:03 +0000)
committersimonpj <unknown>
Mon, 14 May 2001 12:03:41 +0000 (12:03 +0000)
commitea8abf4c09eeaab1fa4839681e09e2fdade03ea1
tree659026698575f75f28e58bed2d587d30ce30d007
parent3bf432001c0cc62ffb7c08c68568af15ba4db624
[project @ 2001-05-14 12:03:41 by simonpj]
**** MERGE WITH 5.00 BRANCH     ********

-----------------------------------------------
Expose record selectors with correct unfoldings
-----------------------------------------------

The problem was that there was that with "ghc --make" we were
passing on record selectors to importing modules in their un-tidied
form.  The idea was that they have very stylised bindings so they
don't need tidying.  But they do, because they may mention error
messages that get floated out.

Here's the comment from CoreTidy.lhs

-- MINOR-HACK ALERT: we *do* tidy record selectors.  Reason: they mention error
-- messages, which may be floated out:
-- x_field pt = case pt of
-- Rect x y -> y
-- Pol _ _  -> error "buggle wuggle"
-- The error message will be floated out so we'll get
-- lvl5 = error "buggle wuggle"
-- x_field pt = case pt of
-- Rect x y -> y
-- Pol _ _  -> lvl5
--
-- When this happens, it's vital that the Id exposed to importing modules
-- (by ghci) mentions lvl5 in its unfolding, not the un-tidied version.
--
-- What about the Id in the TyCon?  It probably shouldn't be in the TyCon at
-- all, but in any case it will have the error message inline so it won't matter.
ghc/compiler/coreSyn/CoreTidy.lhs