From 66644baa950aede979b3c45b5befbde995beef9f Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 16 Aug 2000 13:28:25 +0000 Subject: [PATCH] [project @ 2000-08-16 13:28:25 by simonmar] Don't just pick the back edges ({-# SOURCE #-} imports) when collecting the list of imports for module initialisation. It's entirely possible that a module is only reachable from Main via {-# SOURCE #-} imports. --- ghc/compiler/rename/Rename.lhs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ghc/compiler/rename/Rename.lhs b/ghc/compiler/rename/Rename.lhs index 0f9fe08..68ac301 100644 --- a/ghc/compiler/rename/Rename.lhs +++ b/ghc/compiler/rename/Rename.lhs @@ -161,10 +161,14 @@ rename this_mod@(HsModule mod_name vers exports imports local_decls mod_deprec l getIfacesRn `thenRn` \ ifaces -> let direct_import_mods :: [Module] - direct_import_mods = [m | (_, _, Just (m, _, _, _, ImportByUser, _)) - <- eltsFM (iImpModInfo ifaces)] - -- Pick just the non-back-edge imports - -- (Back edges are ImportByUserSource) + direct_import_mods = [m | (_, _, Just (m, _, _, _, imp, _)) + <- eltsFM (iImpModInfo ifaces), user_import imp] + + -- *don't* just pick the forward edges. It's entirely possible + -- that a module is only reachable via back edges. + user_import ImportByUser = True + user_import ImportByUserSource = True + user_import _ = False this_module = mkThisModule mod_name -- 1.7.10.4