Skip to content
  • Simon Peyton Jones's avatar
    [project @ 2001-05-14 12:03:41 by simonpj] · ea8abf4c
    Simon Peyton Jones authored
    ****	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.
    ea8abf4c