From: simonmar Date: Wed, 8 Jan 2003 15:47:54 +0000 (+0000) Subject: [project @ 2003-01-08 15:47:54 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1286 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=356fb38b253d064d55c018f8da629dda3dcd7eab;p=ghc-hetmet.git [project @ 2003-01-08 15:47:54 by simonmar] Improve the missing module message in the compilation manager, too. --- diff --git a/ghc/compiler/compMan/CompManager.lhs b/ghc/compiler/compMan/CompManager.lhs index 47afe26..07c5dbe 100644 --- a/ghc/compiler/compMan/CompManager.lhs +++ b/ghc/compiler/compMan/CompManager.lhs @@ -1166,11 +1166,9 @@ downsweep roots old_summaries let old_summary = findModInSummaries old_summaries mod summarise mod location old_summary - Left _ -> - throwDyn (CmdLineError - ("can't find module `" - ++ showSDoc (ppr nm) ++ "' (while processing " - ++ show currentMod ++ ")")) + Left files -> do + dflags <- getDynFlags + throwDyn (noModError dflags currentMod nm files) -- loop invariant: env doesn't contain package modules loop :: [(FilePath,ModuleName)] -> ModuleEnv ModSummary -> IO [ModSummary] @@ -1191,6 +1189,18 @@ downsweep roots old_summaries loop new_imps (extendModuleEnvList env [ (ms_mod s, s) | s <- new_home_summaries ]) +-- ToDo: we don't have a proper line number for this error +noModError dflags loc mod_nm files = ProgramError (showSDoc ( + hang (text loc <> colon) 4 $ + (text "Can't find module" <+> quotes (ppr mod_nm) $$ extra) + )) + where + extra + | verbosity dflags < 3 = + text "(use -v to see a list of the files searched for)" + | otherwise = + hang (ptext SLIT("locations searched:")) 4 (vcat (map text files)) + ----------------------------------------------------------------------------- -- Summarising modules