Commit 00cb8789 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Improve debug tracing slighty

parent eb6c3ee0
......@@ -627,8 +627,7 @@ discardWarnings thing_inside
\begin{code}
mkLongErrAt :: SrcSpan -> MsgDoc -> MsgDoc -> TcRn ErrMsg
mkLongErrAt loc msg extra
= do { traceTc "Adding error:" (mkLocMessage SevError loc (msg $$ extra)) ;
rdr_env <- getGlobalRdrEnv ;
= do { rdr_env <- getGlobalRdrEnv ;
dflags <- getDynFlags ;
return $ mkLongErrMsg dflags loc (mkPrintUnqualified dflags rdr_env) msg extra }
......@@ -640,13 +639,15 @@ reportErrors = mapM_ reportError
reportError :: ErrMsg -> TcRn ()
reportError err
= do { errs_var <- getErrsVar ;
= do { traceTc "Adding error:" (pprLocErrMsg err) ;
errs_var <- getErrsVar ;
(warns, errs) <- readTcRef errs_var ;
writeTcRef errs_var (warns, errs `snocBag` err) }
reportWarning :: ErrMsg -> TcRn ()
reportWarning warn
= do { errs_var <- getErrsVar ;
= do { traceTc "Adding warning:" (pprLocErrMsg warn) ;
errs_var <- getErrsVar ;
(warns, errs) <- readTcRef errs_var ;
writeTcRef errs_var (warns `snocBag` warn, errs) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment