[commit: ghc] master: Record selectors should be Exported Ids (ffada1e)
Simon Peyton Jones
simonpj at microsoft.com
Wed Sep 14 13:04:17 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/ffada1e9e717e7d0fb66ce02cdb551b2932f7be1
>---------------------------------------------------------------
commit ffada1e9e717e7d0fb66ce02cdb551b2932f7be1
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri Sep 9 12:50:07 2011 +0100
Record selectors should be Exported Ids
We don't want to drop record selectors as dead code, even if they
aren't exported in the module header. The data type decl in the
inteface file advertises their presenece, and we may get at them via
Template Haskell.
module M( f ) where
data T = MkT { boo :: Int }
f :: T -> T
f = <blah>
We don't want to drop the record selector for 'boo'.
See Trac #4946
>---------------------------------------------------------------
compiler/typecheck/TcTyClsDecls.lhs | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/compiler/typecheck/TcTyClsDecls.lhs b/compiler/typecheck/TcTyClsDecls.lhs
index ad3e4ec..fcc9ec6 100644
--- a/compiler/typecheck/TcTyClsDecls.lhs
+++ b/compiler/typecheck/TcTyClsDecls.lhs
@@ -1262,7 +1262,8 @@ mkRecSelBind (tycon, sel_name)
= (L loc (IdSig sel_id), unitBag (L loc sel_bind))
where
loc = getSrcSpan tycon
- sel_id = Var.mkLocalVar rec_details sel_name sel_ty vanillaIdInfo
+ sel_id = Var.mkExportedLocalVar rec_details sel_name
+ sel_ty vanillaIdInfo
rec_details = RecSelId { sel_tycon = tycon, sel_naughty = is_naughty }
-- Find a representative constructor, con1
More information about the Cvs-ghc
mailing list