From b54a8c67cfe6c59bd4dfa17d3ca15cca0ff85856 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 7 Dec 2000 09:12:33 +0000 Subject: [PATCH] [project @ 2000-12-07 09:12:33 by simonpj] Errors and warnings were back to front --- ghc/compiler/typecheck/TcModule.lhs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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} -- 1.7.10.4