From: sewardj Date: Mon, 14 May 2001 16:40:54 +0000 (+0000) Subject: [project @ 2001-05-14 16:40:54 by sewardj] X-Git-Tag: Approximately_9120_patches~1955 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=7e8d0a0b6ab5e8e328db0ee2c67f6bb9f043b40e;p=ghc-hetmet.git [project @ 2001-05-14 16:40:54 by sewardj] Record-selector unfolding fix #2 --- diff --git a/ghc/compiler/coreSyn/CoreTidy.lhs b/ghc/compiler/coreSyn/CoreTidy.lhs index dc2c600..b0f8dac 100644 --- a/ghc/compiler/coreSyn/CoreTidy.lhs +++ b/ghc/compiler/coreSyn/CoreTidy.lhs @@ -21,8 +21,8 @@ import VarSet import Var ( Id, Var ) import Id ( idType, idInfo, idName, isExportedId, idSpecialisation, idUnique, isDataConWrapId, - mkVanillaGlobal, isLocalId, - hasNoBinding, mkUserLocal + mkVanillaGlobal, isLocalId, isRecordSelector, + setIdUnfolding, hasNoBinding, mkUserLocal ) import IdInfo {- loads of stuff -} import Name ( getOccName, nameOccName, globaliseName, setNameOcc, @@ -414,6 +414,12 @@ tidyTopBinder mod ext_ids cg_info_env tidy_env rhs -- 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. + + | isRecordSelector id -- We can't use the "otherwise" case, because that + -- forgets the IdDetails, which forgets that this is + -- a record selector, which confuses an importing module + = (env, id `setIdUnfolding` unfold_info) + | otherwise -- This function is the heart of Step 2 -- The second env is the one to use for the IdInfo