summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2016-08-31 16:04:11 -0400
committerBen Gamari <ben@smart-cactus.org>2016-08-31 16:34:53 -0400
commitdad6a886802ec4e69104972428fabc75c79a634a (patch)
tree8e03059eba57bf6dffdf3a708f49645ac8f6ca67
parent043604c7232adb698d5008a46d3f29d532acd12d (diff)
downloadhaskell-dad6a886802ec4e69104972428fabc75c79a634a.tar.gz
LoadIFace: Show known names on inconsistent interface file
Reviewers: austin Subscribers: simonpj, ezyang, thomie Differential Revision: https://phabricator.haskell.org/D2466
-rw-r--r--compiler/iface/LoadIface.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/iface/LoadIface.hs b/compiler/iface/LoadIface.hs
index ad5f7d3dbb..c5c3538284 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)
{-