projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve the "could not find module" error message
[ghc-hetmet.git]
/
compiler
/
iface
/
LoadIface.lhs
diff --git
a/compiler/iface/LoadIface.lhs
b/compiler/iface/LoadIface.lhs
index
8bcf987
..
ecba1d6
100644
(file)
--- a/
compiler/iface/LoadIface.lhs
+++ b/
compiler/iface/LoadIface.lhs
@@
-48,7
+48,7
@@
import SrcLoc ( importedSrcLoc )
import Maybes ( MaybeErr(..) )
import ErrUtils ( Message )
import Finder ( findImportedModule, findExactModule,
import Maybes ( MaybeErr(..) )
import ErrUtils ( Message )
import Finder ( findImportedModule, findExactModule,
- FindResult(..), cantFindError )
+ FindResult(..), cannotFindInterface )
import UniqFM
import Outputable
import BinIface ( readBinIface )
import UniqFM
import Outputable
import BinIface ( readBinIface )
@@
-81,14
+81,11
@@
loadSrcInterface doc mod want_boot = do
Found _ mod -> do
mb_iface <- initIfaceTcRn $ loadInterface doc mod (ImportByUser want_boot)
case mb_iface of
Found _ mod -> do
mb_iface <- initIfaceTcRn $ loadInterface doc mod (ImportByUser want_boot)
case mb_iface of
- Failed err -> failWithTc (elaborate err)
+ Failed err -> failWithTc err
Succeeded iface -> return iface
err ->
let dflags = hsc_dflags hsc_env in
Succeeded iface -> return iface
err ->
let dflags = hsc_dflags hsc_env in
- failWithTc (elaborate (cantFindError dflags mod err))
- where
- elaborate err = hang (ptext SLIT("Failed to load interface for") <+>
- quotes (ppr mod) <> colon) 4 err
+ failWithTc (cannotFindInterface dflags mod err)
-- | Load interfaces for a collection of orphan modules.
loadOrphanModules :: [Module] -> TcM ()
-- | Load interfaces for a collection of orphan modules.
loadOrphanModules :: [Module] -> TcM ()
@@
-315,7
+312,8
@@
loadDecl ignore_prags mod (_version, decl)
-- imported name, to fix the module correctly in the cache
mk_new_bndr mod mb_parent occ
= newGlobalBinder mod occ mb_parent
-- imported name, to fix the module correctly in the cache
mk_new_bndr mod mb_parent occ
= newGlobalBinder mod occ mb_parent
- (importedSrcLoc (showSDoc (pprModule mod)))
+ (importedSrcLoc (showSDoc (ppr (moduleName mod))))
+ -- ToDo: qualify with the package name if necessary
doc = ptext SLIT("Declaration for") <+> ppr (ifName decl)
doc = ptext SLIT("Declaration for") <+> ppr (ifName decl)
@@
-419,7
+417,8
@@
findAndReadIface doc_str mod hi_boot_file
Failed err -> do
{ traceIf (ptext SLIT("...not found"))
; dflags <- getDOpts
Failed err -> do
{ traceIf (ptext SLIT("...not found"))
; dflags <- getDOpts
- ; returnM (Failed (cantFindError dflags (moduleName mod) err)) } ;
+ ; returnM (Failed (cannotFindInterface dflags
+ (moduleName mod) err)) } ;
Succeeded file_path -> do
Succeeded file_path -> do