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 <[email protected]> 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 _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
