X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FGHC.hs;h=74959fe4495fc9662d5a8db3186d71652c34a0fd;hb=20f9bf2e066bd22d15a72d6e5efe92c6323bcdbe;hp=207f5a39f0838daae3603c0f2a682f3b807e1417;hpb=8a994e17e7502f31ce2d830ace2f00c305619fa3;p=ghc-hetmet.git diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index 207f5a3..74959fe 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -1631,7 +1631,7 @@ preprocessFile dflags src_fn mb_phase (Just (buf, time)) noModError :: DynFlags -> SrcSpan -> ModuleName -> FindResult -> IO ab -- ToDo: we don't have a proper line number for this error noModError dflags loc wanted_mod err - = throwDyn $ mkPlainErrMsg loc $ cantFindError dflags wanted_mod err + = throwDyn $ mkPlainErrMsg loc $ cannotFindModule dflags wanted_mod err noHsFileErr loc path = throwDyn $ mkPlainErrMsg loc $ text "Can't find" <+> text path @@ -1849,8 +1849,10 @@ 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 - err -> let msg = cantFindError dflags mod_name err in + | 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)) #ifdef GHCI