From 2bad3deb28991726ecff922887f39e51c39e0293 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 22 Aug 2006 11:24:09 +0000 Subject: [PATCH] findModule: add a fallthrough error case --- compiler/main/GHC.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index 0654323..74959fe 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -1849,7 +1849,9 @@ findModule' hsc_env mod_name maybe_pkg = res <- findImportedModule hsc_env mod_name Nothing case res of Found _ m | modulePackageId m /= this_pkg -> return m - -- not allowed to be a home module + | otherwise -> throwDyn (CmdLineError (showSDoc $ + text "module" <+> pprModule m <+> + text "is not loaded")) err -> let msg = cannotFindModule dflags mod_name err in throwDyn (CmdLineError (showSDoc msg)) -- 1.7.10.4