summaryrefslogtreecommitdiff
path: root/compiler/main/DynamicLoading.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/main/DynamicLoading.hs')
-rw-r--r--compiler/main/DynamicLoading.hs21
1 files changed, 5 insertions, 16 deletions
diff --git a/compiler/main/DynamicLoading.hs b/compiler/main/DynamicLoading.hs
index 3b62717a9c..0d72bece36 100644
--- a/compiler/main/DynamicLoading.hs
+++ b/compiler/main/DynamicLoading.hs
@@ -203,15 +203,7 @@ lookupRdrNameInModuleForPlugins hsc_env mod_name rdr_name = do
-- First find the package the module resides in by searching exposed packages and home modules
found_module <- findImportedModule hsc_env mod_name Nothing
case found_module of
- FoundModule h -> check_mod (fr_mod h)
- FoundSigs hs _backing -> check_mods (map fr_mod hs) -- (not tested)
- err -> throwCmdLineErrorS dflags $ cannotFindModule dflags mod_name err
- where
- dflags = hsc_dflags hsc_env
- meth = "lookupRdrNameInModule"
- doc = ptext (sLit $ "contains a name used in an invocation of " ++ meth)
-
- check_mod mod = do
+ Found _ mod -> do
-- Find the exports of the module
(_, mb_iface) <- initTcInteractive hsc_env $
initIfaceTcRn $
@@ -229,13 +221,10 @@ lookupRdrNameInModuleForPlugins hsc_env mod_name rdr_name = do
_ -> panic "lookupRdrNameInModule"
Nothing -> throwCmdLineErrorS dflags $ hsep [ptext (sLit "Could not determine the exports of the module"), ppr mod_name]
-
- check_mods [] = return Nothing
- check_mods (m:ms) = do
- r <- check_mod m
- case r of
- Nothing -> check_mods ms
- Just _ -> return r
+ err -> throwCmdLineErrorS dflags $ cannotFindModule dflags mod_name err
+ where
+ dflags = hsc_dflags hsc_env
+ doc = ptext (sLit "contains a name used in an invocation of lookupRdrNameInModule")
wrongTyThingError :: Name -> TyThing -> SDoc
wrongTyThingError name got_thing = hsep [ptext (sLit "The name"), ppr name, ptext (sLit "is not that of a value but rather a"), pprTyThingCategory got_thing]