From 19b6bb9916325f14cfef3725dcfa8bf750339cb6 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 22 Mar 2004 14:09:03 +0000 Subject: [haddock @ 2004-03-22 14:09:03 by simonmar] getReExports was bogus: we should really look in the import_env to find the documentation for an entity which we are re-exporting without documentation. Suggested by: Ross Paterson (patch modified by me). --- src/Main.hs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/Main.hs') diff --git a/src/Main.hs b/src/Main.hs index c4d03535..a6ae0a24 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -403,7 +403,8 @@ mkInterface no_implicit_prelude verbose mod_map filename package -- find the names exported by this module that other modules should *not* -- link to (and point them to where they should). - reexports = getReExports mdl mod_map exported_names exported_visible_names + reexports = getReExports mdl exported_names exported_visible_names + import_env import_env = local_import_env `plusFM` buildImportEnv mod_map mdl exported_visible_names @@ -824,24 +825,23 @@ all_subs_of_qname _ n@(UnQual _) = -- documentation for those names can be found. This is used for -- constructing the iface_reexports field of the Interface. -getReExports :: Module -> ModuleMap +getReExports :: Module -> [HsQName] -- all exported names -> [HsQName] -- exported names which are documented here + -> FiniteMap HsQName HsQName -> FiniteMap HsName HsQName -getReExports mdl mod_map exported exported_visible - = listToFM (concat (map get_name invisible_names)) +getReExports mdl exported exported_visible import_env + = listToFM (concat invisible_names) where - invisible_names = [ n | n <- exported, n `notElem` exported_visible ] + invisible_names = [ get_name n | n <- exported, + n `notElem` exported_visible ] get_name (UnQual _) = [] - get_name (Qual m n) = - case lookupFM mod_map m of + get_name n@(Qual m un) = + case lookupFM import_env n of Nothing -> [] - Just iface -> - case lookupFM (iface_reexported iface) n of - Just somewhere_else -> [(n, somewhere_else)] - Nothing -> [(n, Qual m n)] - + Just n' -> [(un,n')] + -- ---------------------------------------------------------------------------- -- Building name environments -- cgit v1.2.3