diff options
| author | simonpj <unknown> | 2000-10-13 16:00:45 +0000 |
|---|---|---|
| committer | simonpj <unknown> | 2000-10-13 16:00:45 +0000 |
| commit | 6f619e517abaebb868bff16ba4d2aba086d5108a (patch) | |
| tree | ce1d2ee94a31a3f744a7bfcbd5b59a18e03725be /ghc | |
| parent | f1080bc82f87317ffa59cffef08b322d7354bb29 (diff) | |
| download | haskell-6f619e517abaebb868bff16ba4d2aba086d5108a.tar.gz | |
[project @ 2000-10-13 16:00:45 by simonpj]
Tidy up errors and warnings
Diffstat (limited to 'ghc')
| -rw-r--r-- | ghc/compiler/main/ErrUtils.lhs | 4 | ||||
| -rw-r--r-- | ghc/compiler/rename/Rename.lhs | 4 | ||||
| -rw-r--r-- | ghc/compiler/rename/RnMonad.lhs | 4 | ||||
| -rw-r--r-- | ghc/compiler/typecheck/TcModule.lhs | 4 | ||||
| -rw-r--r-- | ghc/compiler/typecheck/TcMonad.lhs | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/ghc/compiler/main/ErrUtils.lhs b/ghc/compiler/main/ErrUtils.lhs index d6a64f34c8..18b9e38bf6 100644 --- a/ghc/compiler/main/ErrUtils.lhs +++ b/ghc/compiler/main/ErrUtils.lhs @@ -61,9 +61,9 @@ dontAddErrLoc title rest_of_err_msg | otherwise = ( noSrcLoc, hang (text title <> colon) 4 rest_of_err_msg ) -printErrorsAndWarnings :: Bag ErrMsg -> Bag WarnMsg -> IO () +printErrorsAndWarnings :: (Bag WarnMsg, Bag ErrMsg) -> IO () -- Don't print any warnings if there are errors -printErrorsAndWarnings errs warns +printErrorsAndWarnings (warns, errs) | no_errs && no_warns = return () | no_errs = printErrs (pprBagOfWarnings warns) | otherwise = printErrs (pprBagOfErrors errs) diff --git a/ghc/compiler/rename/Rename.lhs b/ghc/compiler/rename/Rename.lhs index 9d340f24c1..33cbe0c384 100644 --- a/ghc/compiler/rename/Rename.lhs +++ b/ghc/compiler/rename/Rename.lhs @@ -84,14 +84,14 @@ renameModule :: PersistentCompilerState -> RdrNameHsModule -> IO (Maybe RenameRe renameModule pcs this_mod@(HsModule mod_name vers exports imports local_decls _ loc) = -- Initialise the renamer monad do { - ((maybe_rn_stuff, dump_action), rn_errs_bag, rn_warns_bag) + ((maybe_rn_stuff, dump_action), msgs) <- initRn pcs (mkThisModule mod_name) (mkSearchPath opt_HiMap) loc (rename this_mod) ; -- Check for warnings - printErrorsAndWarnings rn_errs_bag rn_warns_bag ; + printErrorsAndWarnings msgs ; -- Dump any debugging output dump_action ; diff --git a/ghc/compiler/rename/RnMonad.lhs b/ghc/compiler/rename/RnMonad.lhs index da681040d6..d322c20022 100644 --- a/ghc/compiler/rename/RnMonad.lhs +++ b/ghc/compiler/rename/RnMonad.lhs @@ -297,7 +297,7 @@ initRn :: DynFlags -> Finder -> GlobalSymbolTable -> PersistentRenamerState -> Module -> SrcLoc -> RnMG t - -> IO (t, Bag WarnMsg, Bag ErrMsg) + -> IO (t, (Bag WarnMsg, Bag ErrMsg)) initRn dflags finder gst prs mod loc do_rn = do uniqs <- mkSplitUniqSupply 'r' @@ -322,7 +322,7 @@ initRn dflags finder gst prs mod loc do_rn -- grab errors and return (warns, errs) <- readIORef errs_var - return (res, errs, warns) + return (res, (warns, errs)) initIfaces :: PersistentRenamerState -> Ifaces diff --git a/ghc/compiler/typecheck/TcModule.lhs b/ghc/compiler/typecheck/TcModule.lhs index 62da34d6c5..8b7246549e 100644 --- a/ghc/compiler/typecheck/TcModule.lhs +++ b/ghc/compiler/typecheck/TcModule.lhs @@ -87,9 +87,9 @@ typecheckModule typecheckModule pcs hst (HsModule mod_name _ _ _ decls _ src_loc) = do { env <- initTcEnv global_symbol_table global_inst_env ; - (_, (maybe_result, warns, errs)) <- initTc env src_loc tc_module + (_, (maybe_result, msgs)) <- initTc env src_loc tc_module - printErrorsAndWarnings errs warns ; + printErrorsAndWarnings msgs ; printTcDumps maybe_result ; diff --git a/ghc/compiler/typecheck/TcMonad.lhs b/ghc/compiler/typecheck/TcMonad.lhs index f104fbecbb..21a8d8959f 100644 --- a/ghc/compiler/typecheck/TcMonad.lhs +++ b/ghc/compiler/typecheck/TcMonad.lhs @@ -126,7 +126,7 @@ type TcRef a = IORef a initTc :: TcEnv -> SrcLoc -> TcM r - -> IO (Maybe r, Bag WarnMsg, Bag ErrMsg) + -> IO (Maybe r, (Bag ErrMsg, Bag WarnMsg)) initTc tc_env src_loc do_this = do { @@ -147,7 +147,7 @@ initTc tc_env src_loc do_this (\_ -> return Nothing) ; (warns,errs) <- readIORef errs_var ; - return (maybe_res, warns, errs) + return (maybe_res, (warns, errs)) } -- Monadic operations |
