summaryrefslogtreecommitdiff
path: root/compiler/iface/LoadIface.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2015-09-11 17:13:30 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2015-09-21 11:11:48 -0700
commit3f13c20e0c29d3db974c2a0d7d5ec15abd5a434b (patch)
tree0beb42ce43328983d54718bf835e82ea48c8d2db /compiler/iface/LoadIface.hs
parentc234acbe76da85556befad3eaa0c7c6b31e9e1c3 (diff)
downloadhaskell-3f13c20e0c29d3db974c2a0d7d5ec15abd5a434b.tar.gz
Revert "Revert "Revert "Support for multiple signature files in scope."""
This reverts commit 214596de224afa576a9c295bcf53c6941d6892e0.
Diffstat (limited to 'compiler/iface/LoadIface.hs')
-rw-r--r--compiler/iface/LoadIface.hs18
1 files changed, 6 insertions, 12 deletions
diff --git a/compiler/iface/LoadIface.hs b/compiler/iface/LoadIface.hs
index 60e3a8a446..68143f959b 100644
--- a/compiler/iface/LoadIface.hs
+++ b/compiler/iface/LoadIface.hs
@@ -298,17 +298,12 @@ loadSrcInterface_maybe doc mod want_boot maybe_pkg
-- interface; it will call the Finder again, but the ModLocation will be
-- cached from the first search.
= do { hsc_env <- getTopEnv
+ -- ToDo: findImportedModule should return a list of interfaces
; res <- liftIO $ findImportedModule hsc_env mod maybe_pkg
; case res of
- FoundModule (FoundHs { fr_mod = mod })
- -> fmap (fmap (:[]))
- . initIfaceTcRn
- $ loadInterface doc mod (ImportByUser want_boot)
- FoundSigs mods _backing
- -> initIfaceTcRn $ do
- ms <- forM mods $ \(FoundHs { fr_mod = mod }) ->
- loadInterface doc mod (ImportByUser want_boot)
- return (sequence ms)
+ Found _ mod -> fmap (fmap (:[]))
+ . initIfaceTcRn
+ $ loadInterface doc mod (ImportByUser want_boot)
err -> return (Failed (cannotFindInterface (hsc_dflags hsc_env) mod err)) }
-- | Load interface directly for a fully qualified 'Module'. (This is a fairly
@@ -746,7 +741,7 @@ findAndReadIface doc_str mod hi_boot_file
hsc_env <- getTopEnv
mb_found <- liftIO (findExactModule hsc_env mod)
case mb_found of
- FoundExact loc mod -> do
+ Found loc mod -> do
-- Found file, so read it
let file_path = addBootSuffix_maybe hi_boot_file
@@ -763,8 +758,7 @@ findAndReadIface doc_str mod hi_boot_file
traceIf (ptext (sLit "...not found"))
dflags <- getDynFlags
return (Failed (cannotFindInterface dflags
- (moduleName mod)
- (convFindExactResult err)))
+ (moduleName mod) err))
where read_file file_path = do
traceIf (ptext (sLit "readIFace") <+> text file_path)
read_result <- readIface mod file_path