X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcRnMonad.lhs;h=8f8a6df396f28fd1bb43e271d8c9241ee54d3f2e;hb=1f5e55804b97d2b9a77207d568d602ba88d8855d;hp=de3390c178813951ca3b37c841284fde19cd7a4b;hpb=599e42c2948811e71607c5167d9345ddd74d83c3;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcRnMonad.lhs b/ghc/compiler/typecheck/TcRnMonad.lhs index de3390c..8f8a6df 100644 --- a/ghc/compiler/typecheck/TcRnMonad.lhs +++ b/ghc/compiler/typecheck/TcRnMonad.lhs @@ -385,8 +385,8 @@ addErrs msgs = mappM_ add msgs where add (loc,msg) = addErrAt loc msg -addWarn :: Message -> TcRn () -addWarn msg +addReport :: Message -> TcRn () +addReport msg = do { errs_var <- getErrsVar ; loc <- getSrcLocM ; rdr_env <- getGlobalRdrEnv ; @@ -394,6 +394,9 @@ addWarn msg (warns, errs) <- readMutVar errs_var ; writeMutVar errs_var (warns `snocBag` warn, errs) } +addWarn :: Message -> TcRn () +addWarn msg = addReport (ptext SLIT("Warning:") <+> msg) + checkErr :: Bool -> Message -> TcRn () -- Add the error if the bool is False checkErr ok msg = checkM ok (addErr msg)