diff options
author | Konstantine Rybnikov <k-bx@k-bx.com> | 2015-04-14 01:38:54 -0500 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2015-04-14 07:33:07 -0500 |
commit | 7febc2bb86b238713cfb9f52dff32039464dfe66 (patch) | |
tree | 7b51542fbb01c3ed5d0327eb62f2dc9792ebea3b /compiler | |
parent | a2ce3afaeb5c32556760b9b5185778a4062ba998 (diff) | |
download | haskell-7febc2bb86b238713cfb9f52dff32039464dfe66.tar.gz |
Add "error:" prefix to error-messages
Add "error:" prefix to error-messages, also lowercase "Warning:"
message to match GCC behavior closer.
Reviewed By: thomie, austin
Differential Revision: https://phabricator.haskell.org/D811
GHC Trac Issues: #10021
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/main/ErrUtils.hs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/compiler/main/ErrUtils.hs b/compiler/main/ErrUtils.hs index 5762a57f3e..d42db57808 100644 --- a/compiler/main/ErrUtils.hs +++ b/compiler/main/ErrUtils.hs @@ -111,10 +111,6 @@ data Severity | SevError | SevFatal -isWarning :: Severity -> Bool -isWarning SevWarning = True -isWarning _ = False - instance Show ErrMsg where show em = errMsgShortString em @@ -132,10 +128,13 @@ mkLocMessage severity locn msg else ppr (srcSpanStart locn) in hang (locn' <> colon <+> sev_info) 4 msg where - sev_info = ppWhen (isWarning severity) - (ptext (sLit "Warning:")) - -- For warnings, print Foo.hs:34: Warning: - -- <the warning message> + -- Add prefixes, like Foo.hs:34: warning: + -- <the warning message> + sev_info = case severity of + SevWarning -> ptext (sLit "warning:") + SevError -> ptext (sLit "error:") + SevFatal -> ptext (sLit "fatal:") + _ -> empty makeIntoWarning :: ErrMsg -> ErrMsg makeIntoWarning err = err { errMsgSeverity = SevWarning } |