X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcRnTypes.lhs;h=be37c16940f96802c1b72f9cc985d56e9daa6004;hp=3c23921207adb680755cbf2e408d089b347b4f80;hb=2eb04ca0f8d0ec72b417cddc60672c696b4a3daa;hpb=74b27e20425336403d80e942ee3faf00f8c36ef8 diff --git a/compiler/typecheck/TcRnTypes.lhs b/compiler/typecheck/TcRnTypes.lhs index 3c23921..be37c16 100644 --- a/compiler/typecheck/TcRnTypes.lhs +++ b/compiler/typecheck/TcRnTypes.lhs @@ -13,7 +13,7 @@ module TcRnTypes( IfGblEnv(..), IfLclEnv(..), -- Ranamer types - ErrCtxt, + ErrCtxt, RecFieldEnv, ImportAvails(..), emptyImportAvails, plusImportAvails, WhereFrom(..), mkModDeps, @@ -133,7 +133,8 @@ data TcGblEnv tcg_default :: Maybe [Type], -- Types used for defaulting -- Nothing => no 'default' decl - tcg_fix_env :: FixityEnv, -- Just for things in this module + tcg_fix_env :: FixityEnv, -- Just for things in this module + tcg_field_env :: RecFieldEnv, -- Just for things in this module tcg_type_env :: TypeEnv, -- Global type env for the module we are compiling now -- All TyCons and Classes (for this module) end up in here right away, @@ -227,6 +228,14 @@ data TcGblEnv tcg_doc :: Maybe (HsDoc Name), -- Maybe Haddock documentation tcg_hmi :: HaddockModInfo Name -- Haddock module information } + +type RecFieldEnv = NameEnv [Name] -- Maps a constructor name *in this module* + -- to the fields for that constructor + -- This is used when dealing with ".." notation in record + -- construction and pattern matching. + -- The FieldEnv deals *only* with constructors defined in + -- *thie* module. For imported modules, we get the same info + -- from the TypeEnv \end{code} %************************************************************************