From ca857af46ba888ff8fec3f0e93ebbe3343b7abf8 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 22 Jun 2010 08:41:50 +0000 Subject: isLocalAndTypeInferenced: fix for local module names overlapping package modules --- src/Haddock/Interface/Create.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Haddock/Interface/Create.hs') diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 224df2c4..c33e36cf 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -560,8 +560,12 @@ mkExportItems modMap this_mod gre exported_names decls declMap -- But I might be missing something obvious. What's important -- /here/ is that we behave reasonably when we run into one of -- those exported type-inferenced values. - isLocalAndTypeInferenced <- liftGhcToErrMsgGhc $ - isLoaded (moduleName (nameModule t)) + isLocalAndTypeInferenced <- liftGhcToErrMsgGhc $ do + let mdl = nameModule t + if modulePackageId mdl == thisPackage dflags + then isLoaded (moduleName mdl) + else return False + if isLocalAndTypeInferenced then do -- I don't think there can be any subs in this case, -- cgit v1.2.3