From: simonpj Date: Thu, 7 Dec 2000 09:12:33 +0000 (+0000) Subject: [project @ 2000-12-07 09:12:33 by simonpj] X-Git-Tag: Approximately_9120_patches~3179 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=b54a8c67cfe6c59bd4dfa17d3ca15cca0ff85856;p=ghc-hetmet.git [project @ 2000-12-07 09:12:33 by simonpj] Errors and warnings were back to front --- diff --git a/ghc/compiler/typecheck/TcModule.lhs b/ghc/compiler/typecheck/TcModule.lhs index 3bd6902..3d58d8e 100644 --- a/ghc/compiler/typecheck/TcModule.lhs +++ b/ghc/compiler/typecheck/TcModule.lhs @@ -43,7 +43,7 @@ import TcTyClsDecls ( tcTyAndClassDecls ) import CoreUnfold ( unfoldingTemplate, hasUnfolding ) import Type ( funResultTy, splitForAllTys, openTypeKind ) import Bag ( isEmptyBag ) -import ErrUtils ( printErrorsAndWarnings, dumpIfSet_dyn, showPass ) +import ErrUtils ( printErrorsAndWarnings, errorsFound, dumpIfSet_dyn, showPass ) import Id ( idType, idUnfolding ) import Module ( Module ) import Name ( Name, toRdrName ) @@ -51,7 +51,6 @@ import Name ( nameEnvElts, lookupNameEnv ) import TyCon ( tyConGenInfo ) import Util import BasicTypes ( EP(..), Fixity ) -import Bag ( isEmptyBag ) import Outputable import HscTypes ( PersistentCompilerState(..), HomeSymbolTable, PackageTypeEnv, ModIface(..), @@ -141,14 +140,14 @@ typecheck dflags pcs hst unqual thing_inside = do { showPass dflags "Typechecker"; ; env <- initTcEnv hst (pcs_PTE pcs) - ; (maybe_tc_result, (warns,errs)) <- initTc dflags env thing_inside + ; (maybe_tc_result, errs) <- initTc dflags env thing_inside - ; printErrorsAndWarnings unqual (errs,warns) + ; printErrorsAndWarnings unqual errs - ; if isEmptyBag errs then - return maybe_tc_result - else + ; if errorsFound errs then return Nothing + else + return maybe_tc_result } \end{code}