diff options
author | Alfredo Di Napoli <alfredo@well-typed.com> | 2021-01-04 15:35:47 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-01-22 15:00:47 -0500 |
commit | a64f21e9f6bd949847d3c8fa1e427e5c763ccd7f (patch) | |
tree | cdf6eb8daa58254190a0c8dacdc681b13c3ba884 /compiler/GHC/Parser/Header.hs | |
parent | 34950fb84b85d964e30ae9eca995b84fbf4fd165 (diff) | |
download | haskell-a64f21e9f6bd949847d3c8fa1e427e5c763ccd7f.tar.gz |
Parameterise Messages over e
This commit paves the way to a richer and more structured representation
of GHC error messages, as per GHC proposal #306. More specifically
'Messages' from 'GHC.Types.Error' now gains an extra type parameter,
that we instantiate to 'ErrDoc' for now. Later, this will allow us to
replace ErrDoc with something more structure (for example messages
coming from the parser, the typechecker etc).
Diffstat (limited to 'compiler/GHC/Parser/Header.hs')
-rw-r--r-- | compiler/GHC/Parser/Header.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/GHC/Parser/Header.hs b/compiler/GHC/Parser/Header.hs index 8c0a876c36..8634d8c495 100644 --- a/compiler/GHC/Parser/Header.hs +++ b/compiler/GHC/Parser/Header.hs @@ -39,7 +39,7 @@ import GHC.Hs import GHC.Unit.Module import GHC.Builtin.Names -import GHC.Types.Error +import GHC.Types.Error hiding ( getErrorMessages, getWarningMessages ) import GHC.Types.SrcLoc import GHC.Types.SourceError import GHC.Types.SourceText @@ -52,7 +52,7 @@ import GHC.Utils.Exception as Exception import GHC.Data.StringBuffer import GHC.Data.Maybe -import GHC.Data.Bag ( Bag, emptyBag, listToBag, unitBag, isEmptyBag ) +import GHC.Data.Bag ( Bag, listToBag, unitBag, isEmptyBag ) import GHC.Data.FastString import Control.Monad @@ -348,9 +348,9 @@ unsupportedExtnError dflags loc unsup = suggestions = fuzzyMatch unsup supported -optionsErrorMsgs :: [String] -> [Located String] -> FilePath -> Messages +optionsErrorMsgs :: [String] -> [Located String] -> FilePath -> Messages ErrDoc optionsErrorMsgs unhandled_flags flags_lines _filename - = (emptyBag, listToBag (map mkMsg unhandled_flags_lines)) + = mkMessages $ listToBag (map mkMsg unhandled_flags_lines) where unhandled_flags_lines :: [Located String] unhandled_flags_lines = [ L l f | f <- unhandled_flags |