[commit: ghc] wip/names3: LoadIFace: Show known names on inconsistent interface file (00ed93b)

git at git.haskell.org git at git.haskell.org
Thu Sep 8 18:52:20 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/names3
Link       : http://ghc.haskell.org/trac/ghc/changeset/00ed93bcbbea356a9b839cc57fee46acd4dffee8/ghc

>---------------------------------------------------------------

commit 00ed93bcbbea356a9b839cc57fee46acd4dffee8
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Sat Aug 20 09:11:31 2016 -0400

    LoadIFace: Show known names on inconsistent interface file


>---------------------------------------------------------------

00ed93bcbbea356a9b839cc57fee46acd4dffee8
 compiler/iface/LoadIface.hs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/compiler/iface/LoadIface.hs b/compiler/iface/LoadIface.hs
index ad5f7d3..c5c3538 100644
--- a/compiler/iface/LoadIface.hs
+++ b/compiler/iface/LoadIface.hs
@@ -138,7 +138,7 @@ importDecl name
         { eps <- getEps
         ; case lookupTypeEnv (eps_PTE eps) name of
             Just thing -> return (Succeeded thing)
-            Nothing    -> return (Failed not_found_msg)
+            Nothing    -> return $ Failed (ifPprDebug (found_things_msg eps) $$ not_found_msg)
     }}}
   where
     nd_doc = text "Need decl for" <+> ppr name
@@ -146,6 +146,11 @@ importDecl name
                                 pprNameSpace (occNameSpace (nameOccName name)) <+> ppr name)
                        2 (vcat [text "Probable cause: bug in .hi-boot file, or inconsistent .hi file",
                                 text "Use -ddump-if-trace to get an idea of which file caused the error"])
+    found_things_msg eps =
+        hang (text "Found the following declarations in" <+> ppr (nameModule name) <> colon)
+           2 (vcat (map ppr $ filter is_interesting $ nameEnvElts $ eps_PTE eps))
+      where
+        is_interesting thing = nameModule name == nameModule (getName thing)
 
 
 {-



More information about the ghc-commits mailing list