From: simonmar Date: Mon, 26 Jan 2004 09:56:30 +0000 (+0000) Subject: [project @ 2004-01-26 09:56:29 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~120 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=f23d940ee5d97f4395bf4f4c87a5b4a6a30af9d8 [project @ 2004-01-26 09:56:29 by simonmar] unbreak the build --- diff --git a/ghc/compiler/typecheck/TcRnDriver.lhs b/ghc/compiler/typecheck/TcRnDriver.lhs index 8df2efc..2f7aef2 100644 --- a/ghc/compiler/typecheck/TcRnDriver.lhs +++ b/ghc/compiler/typecheck/TcRnDriver.lhs @@ -228,7 +228,7 @@ tcRnStmt :: HscEnv -- a list of the bound values, coerced to (). tcRnStmt hsc_env ictxt rdr_stmt - = initTc hsc_env iNTERACTIVE $ + = initTcPrintErrors hsc_env iNTERACTIVE $ setInteractiveContext ictxt $ do { -- Rename; use CmdLineMode because tcRnStmt is only used interactively @@ -400,7 +400,7 @@ tcRnExpr :: HscEnv -> LHsExpr RdrName -> IO (Maybe Type) tcRnExpr hsc_env ictxt rdr_expr - = initTc hsc_env iNTERACTIVE $ + = initTcPrintErrors hsc_env iNTERACTIVE $ setInteractiveContext ictxt $ do { (rn_expr, fvs) <- rnLExpr rdr_expr ; @@ -433,7 +433,7 @@ tcRnThing :: HscEnv -- *and* as a type or class constructor; -- hence the call to dataTcOccs, and we return up to two results tcRnThing hsc_env ictxt rdr_name - = initTc hsc_env iNTERACTIVE $ + = initTcPrintErrors hsc_env iNTERACTIVE $ setInteractiveContext ictxt $ do { -- If the identifier is a constructor (begins with an @@ -804,7 +804,7 @@ mkExportEnv :: HscEnv -> [ModuleName] -- Expose these modules' exports only -> IO GlobalRdrEnv mkExportEnv hsc_env exports - = do { mb_envs <- initTc hsc_env iNTERACTIVE $ + = do { mb_envs <- initTcPrintErrors hsc_env iNTERACTIVE $ mappM getModuleExports exports ; case mb_envs of Just envs -> return (foldr plusGlobalRdrEnv emptyGlobalRdrEnv envs) @@ -836,7 +836,7 @@ getModuleContents -> IO (Maybe [IfaceDecl]) getModuleContents hsc_env ictxt mod exports_only - = initTc hsc_env iNTERACTIVE (get_mod_contents exports_only) + = initTcPrintErrors hsc_env iNTERACTIVE (get_mod_contents exports_only) where get_mod_contents exports_only | not exports_only -- We want the whole top-level type env diff --git a/ghc/compiler/typecheck/TcRnMonad.lhs b/ghc/compiler/typecheck/TcRnMonad.lhs index 350aca0..86af49a 100644 --- a/ghc/compiler/typecheck/TcRnMonad.lhs +++ b/ghc/compiler/typecheck/TcRnMonad.lhs @@ -131,6 +131,16 @@ initTc hsc_env mod do_this -- list, and there are no bindings in M, we don't bleat -- "unknown module M". +initTcPrintErrors + :: HscEnv + -> Module + -> TcM r + -> IO (Maybe r) +initTcPrintErrors env mod todo = do + (msgs, res) <- initTc env mod todo + printErrorsAndWarnings msgs + return res + mkImpInstEnv :: HscEnv -> InstEnv -- At the moment we (wrongly) build an instance environment from all the -- home-package modules we have already compiled.