diff options
author | Alfredo Di Napoli <alfredo@well-typed.com> | 2021-04-06 16:27:14 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-04-29 17:27:19 -0400 |
commit | 7d18e1bace3f3a85eae177654690d91b688c0e8f (patch) | |
tree | fca073e898068e90dd49c4ea9243c628dbb4469b /testsuite/tests/parser | |
parent | 7bb3443a4fe8acfaa3fec34f58c91173f737777d (diff) | |
download | haskell-7d18e1bace3f3a85eae177654690d91b688c0e8f.tar.gz |
Add GhcMessage and ancillary types
This commit adds GhcMessage and ancillary (PsMessage, TcRnMessage, ..)
types.
These types will be expanded to represent more errors generated
by different subsystems within GHC. Right now, they are underused,
but more will come in the glorious future.
See
https://gitlab.haskell.org/ghc/ghc/-/wikis/Errors-as-(structured)-values
for a design overview.
Along the way, lots of other things had to happen:
* Adds Semigroup and Monoid instance for Bag
* Fixes #19746 by parsing OPTIONS_GHC pragmas into Located Strings.
See GHC.Parser.Header.toArgs (moved from GHC.Utils.Misc, where it
didn't belong anyway).
* Addresses (but does not completely fix) #19709, now reporting
desugarer warnings and errors appropriately for TH splices.
Not done: reporting type-checker warnings for TH splices.
* Some small refactoring around Safe Haskell inference, in order
to keep separate classes of messages separate.
* Some small refactoring around initDsTc, in order to keep separate
classes of messages separate.
* Separate out the generation of messages (that is, the construction
of the text block) from the wrapping of messages (that is, assigning
a SrcSpan). This is more modular than the previous design, which
mixed the two.
Close #19746.
This was a collaborative effort by Alfredo di Napoli and
Richard Eisenberg, with a key assist on #19746 by Iavor
Diatchki.
Metric Increase:
MultiLayerModules
Diffstat (limited to 'testsuite/tests/parser')
5 files changed, 24 insertions, 6 deletions
diff --git a/testsuite/tests/parser/should_compile/T16619.stderr b/testsuite/tests/parser/should_compile/T16619.stderr index 68a8bf5da8..aab7175abd 100644 --- a/testsuite/tests/parser/should_compile/T16619.stderr +++ b/testsuite/tests/parser/should_compile/T16619.stderr @@ -1,3 +1,3 @@ -T16619.hs:2:12: warning: [-Wdeprecated-flags (in -Wdefault)] +T16619.hs:2:13: warning: [-Wdeprecated-flags (in -Wdefault)] -Wmissing-space-after-bang is deprecated: bang patterns can no longer be written with a space diff --git a/testsuite/tests/parser/should_fail/T16270.stderr b/testsuite/tests/parser/should_fail/T16270.stderr index 6666ac7963..323d9c93e3 100644 --- a/testsuite/tests/parser/should_fail/T16270.stderr +++ b/testsuite/tests/parser/should_fail/T16270.stderr @@ -1,5 +1,5 @@ -T16270.hs:3:12: warning: [-Wdeprecated-flags (in -Wdefault)] +T16270.hs:3:13: warning: [-Wdeprecated-flags (in -Wdefault)] -Werror=missing-space-after-bang is deprecated: bang patterns can no longer be written with a space T16270.hs:8:1: warning: [-Wtabs (in -Wdefault)] diff --git a/testsuite/tests/parser/should_fail/readFail044.stderr b/testsuite/tests/parser/should_fail/readFail044.stderr index 27becac67c..1976b56079 100644 --- a/testsuite/tests/parser/should_fail/readFail044.stderr +++ b/testsuite/tests/parser/should_fail/readFail044.stderr @@ -1,6 +1,6 @@ -readFail044.hs:3:16: +readFail044.hs:3:17: error: unknown flag in {-# OPTIONS_GHC #-} pragma: -this-flag-does-not-exist -readFail044.hs:3:16: +readFail044.hs:3:43: error: unknown flag in {-# OPTIONS_GHC #-} pragma: -nor-does-this-one diff --git a/testsuite/tests/parser/should_run/CountAstDeps.stdout b/testsuite/tests/parser/should_run/CountAstDeps.stdout index a9479a9d8d..cb96d95d78 100644 --- a/testsuite/tests/parser/should_run/CountAstDeps.stdout +++ b/testsuite/tests/parser/should_run/CountAstDeps.stdout @@ -1,4 +1,4 @@ -Found 245 Language.Haskell.Syntax module dependencies +Found 255 Language.Haskell.Syntax module dependencies GHC.Builtin.Names GHC.Builtin.PrimOps GHC.Builtin.Types @@ -83,6 +83,8 @@ GHC.Driver.CmdLine GHC.Driver.Env GHC.Driver.Env.Types GHC.Driver.Errors +GHC.Driver.Errors.Ppr +GHC.Driver.Errors.Types GHC.Driver.Flags GHC.Driver.Hooks GHC.Driver.Monad @@ -103,12 +105,18 @@ GHC.Hs.Lit GHC.Hs.Pat GHC.Hs.Type GHC.Hs.Utils +GHC.HsToCore.Errors.Ppr +GHC.HsToCore.Errors.Types GHC.Iface.Ext.Fields GHC.Iface.Recomp.Binary GHC.Iface.Syntax GHC.Iface.Type GHC.Linker.Types GHC.Parser.Annotation +GHC.Parser.Errors +GHC.Parser.Errors.Ppr +GHC.Parser.Errors.Types +GHC.Parser.Types GHC.Platform GHC.Platform.AArch64 GHC.Platform.ARM @@ -138,6 +146,8 @@ GHC.StgToCmm.Types GHC.SysTools.BaseDir GHC.SysTools.Terminal GHC.Tc.Errors.Hole.FitTypes +GHC.Tc.Errors.Ppr +GHC.Tc.Errors.Types GHC.Tc.Types GHC.Tc.Types.Constraint GHC.Tc.Types.Evidence diff --git a/testsuite/tests/parser/should_run/CountParserDeps.stdout b/testsuite/tests/parser/should_run/CountParserDeps.stdout index 73a238fd09..82daac1a97 100644 --- a/testsuite/tests/parser/should_run/CountParserDeps.stdout +++ b/testsuite/tests/parser/should_run/CountParserDeps.stdout @@ -1,4 +1,4 @@ -Found 253 GHC.Parser module dependencies +Found 261 GHC.Parser module dependencies GHC.Builtin.Names GHC.Builtin.PrimOps GHC.Builtin.Types @@ -84,6 +84,8 @@ GHC.Driver.CmdLine GHC.Driver.Env GHC.Driver.Env.Types GHC.Driver.Errors +GHC.Driver.Errors.Ppr +GHC.Driver.Errors.Types GHC.Driver.Flags GHC.Driver.Hooks GHC.Driver.Monad @@ -104,6 +106,8 @@ GHC.Hs.Lit GHC.Hs.Pat GHC.Hs.Type GHC.Hs.Utils +GHC.HsToCore.Errors.Ppr +GHC.HsToCore.Errors.Types GHC.Iface.Ext.Fields GHC.Iface.Recomp.Binary GHC.Iface.Syntax @@ -113,6 +117,8 @@ GHC.Parser GHC.Parser.Annotation GHC.Parser.CharClass GHC.Parser.Errors +GHC.Parser.Errors.Ppr +GHC.Parser.Errors.Types GHC.Parser.Lexer GHC.Parser.PostProcess GHC.Parser.PostProcess.Haddock @@ -146,6 +152,8 @@ GHC.StgToCmm.Types GHC.SysTools.BaseDir GHC.SysTools.Terminal GHC.Tc.Errors.Hole.FitTypes +GHC.Tc.Errors.Ppr +GHC.Tc.Errors.Types GHC.Tc.Types GHC.Tc.Types.Constraint GHC.Tc.Types.Evidence |