diff options
author | Alfredo Di Napoli <alfredo@well-typed.com> | 2021-03-26 10:17:26 +0100 |
---|---|---|
committer | Alfredo Di Napoli <alfredo@well-typed.com> | 2021-03-29 07:58:00 +0200 |
commit | c30af95189c5006ac5cd10839a8ea7e8098341d5 (patch) | |
tree | 8863e8d15ab33363147594dbab2d54cf7cb42a48 /testsuite/tests/partial-sigs | |
parent | 9c9e40e59214b1e358c85852218f3a67e712a748 (diff) | |
download | haskell-c30af95189c5006ac5cd10839a8ea7e8098341d5.tar.gz |
Add `MessageClass`, rework `Severity` and add `DiagnosticReason`.wip/adinapoli-message-class-new-design
Other than that:
* Fix T16167,json,json2,T7478,T10637 tests to reflect the introduction of
the `MessageClass` type
* Remove `makeIntoWarning`
* Remove `warningsToMessages`
* Refactor GHC.Tc.Errors
1. Refactors GHC.Tc.Errors so that we use `DiagnosticReason` for "choices"
(defer types errors, holes, etc);
2. We get rid of `reportWarning` and `reportError` in favour of a general
`reportDiagnostic`.
* Introduce `DiagnosticReason`, `Severity` is an enum: This big commit makes
`Severity` a simple enumeration, and introduces the concept of `DiagnosticReason`,
which classifies the /reason/ why we are emitting a particular diagnostic.
It also adds a monomorphic `DiagnosticMessage` type which is used for
generic messages.
* The `Severity` is computed (for now) from the reason, statically.
Later improvement will add a `diagReasonSeverity` function to compute
the `Severity` taking `DynFlags` into account.
* Rename `logWarnings` into `logDiagnostics`
* Add note and expand description of the `mkHoleError` function
Diffstat (limited to 'testsuite/tests/partial-sigs')
4 files changed, 20 insertions, 16 deletions
diff --git a/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr b/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr index 7a0ad230f4..285060c0c9 100644 --- a/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr +++ b/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr @@ -34,7 +34,7 @@ SplicesUsed.hs:10:16: warning: [-Wpartial-type-signatures (in -Wdefault)] In the type signature: charA :: a -> (_) SplicesUsed.hs:13:13: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘[a]’ + • Found type wildcard ‘_’ standing for ‘a -> Bool’ Where: ‘a’ is a rigid type variable bound by the inferred type of filter' :: (a -> Bool) -> [a] -> [a] at SplicesUsed.hs:14:1-16 @@ -50,7 +50,7 @@ SplicesUsed.hs:13:13: warning: [-Wpartial-type-signatures (in -Wdefault)] In the type signature: filter' :: (_ -> _ -> _) SplicesUsed.hs:13:13: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘a -> Bool’ + • Found type wildcard ‘_’ standing for ‘[a]’ Where: ‘a’ is a rigid type variable bound by the inferred type of filter' :: (a -> Bool) -> [a] -> [a] at SplicesUsed.hs:14:1-16 @@ -58,26 +58,27 @@ SplicesUsed.hs:13:13: warning: [-Wpartial-type-signatures (in -Wdefault)] In the type signature: filter' :: (_ -> _ -> _) SplicesUsed.hs:16:2: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘a -> a -> Bool’ + • Found extra-constraints wildcard standing for ‘Eq a’ Where: ‘a’ is a rigid type variable bound by the inferred type of foo :: Eq a => a -> a -> Bool at SplicesUsed.hs:16:2-11 • In the type signature: foo :: _ => _ SplicesUsed.hs:16:2: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found extra-constraints wildcard standing for ‘Eq a’ + • Found type wildcard ‘_’ standing for ‘a -> a -> Bool’ Where: ‘a’ is a rigid type variable bound by the inferred type of foo :: Eq a => a -> a -> Bool at SplicesUsed.hs:16:2-11 • In the type signature: foo :: _ => _ SplicesUsed.hs:18:2: warning: [-Wpartial-type-signatures (in -Wdefault)] + • Found type wildcard ‘_a’ standing for ‘Bool’ + • In the type signature: bar :: _a -> _b -> (_a, _b) + +SplicesUsed.hs:18:2: warning: [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_b’ standing for ‘w’ Where: ‘w’ is a rigid type variable bound by the inferred type of bar :: Bool -> w -> (Bool, w) at SplicesUsed.hs:18:2-11 • In the type signature: bar :: _a -> _b -> (_a, _b) -SplicesUsed.hs:18:2: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_a’ standing for ‘Bool’ - • In the type signature: bar :: _a -> _b -> (_a, _b) diff --git a/testsuite/tests/partial-sigs/should_compile/T14643.stderr b/testsuite/tests/partial-sigs/should_compile/T14643.stderr index e2dd144bd3..9c56cb629f 100644 --- a/testsuite/tests/partial-sigs/should_compile/T14643.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T14643.stderr @@ -1,8 +1,9 @@ T14643.hs:5:18: warning: [-Wpartial-type-signatures (in -Wdefault)] • Found extra-constraints wildcard standing for ‘()’ - • In the type signature: ag :: (Num a, _) => a -> a + • In the type signature: af :: (Num a, _) => a -> a T14643.hs:5:18: warning: [-Wpartial-type-signatures (in -Wdefault)] • Found extra-constraints wildcard standing for ‘()’ - • In the type signature: af :: (Num a, _) => a -> a + • In the type signature: ag :: (Num a, _) => a -> a + diff --git a/testsuite/tests/partial-sigs/should_compile/T16728a.stderr b/testsuite/tests/partial-sigs/should_compile/T16728a.stderr index a23c189c4b..2c7e597623 100644 --- a/testsuite/tests/partial-sigs/should_compile/T16728a.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T16728a.stderr @@ -7,7 +7,7 @@ T16728a.hs:4:22: warning: [-Wpartial-type-signatures (in -Wdefault)] h :: a -> w at T16728a.hs:(5,1)-(7,9) • In the type ‘a -> _’ - In the type signature: h :: forall a. a -> _ + In the type signature: g :: forall a. a -> _ T16728a.hs:4:22: warning: [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘w’ @@ -17,4 +17,5 @@ T16728a.hs:4:22: warning: [-Wpartial-type-signatures (in -Wdefault)] h :: a -> w at T16728a.hs:(5,1)-(7,9) • In the type ‘a -> _’ - In the type signature: g :: forall a. a -> _ + In the type signature: h :: forall a. a -> _ + diff --git a/testsuite/tests/partial-sigs/should_compile/T16728b.stderr b/testsuite/tests/partial-sigs/should_compile/T16728b.stderr index 9948e78198..84d10c1f45 100644 --- a/testsuite/tests/partial-sigs/should_compile/T16728b.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T16728b.stderr @@ -1,13 +1,14 @@ T16728b.hs:4:22: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘Bool’ - • In the type ‘a -> _’ - In the type signature: h :: forall a. a -> _ - -T16728b.hs:4:22: warning: [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘a’ Where: ‘a’ is a rigid type variable bound by the inferred type of g :: a -> a at T16728b.hs:4:14 • In the type ‘a -> _’ In the type signature: g :: forall a. a -> _ + +T16728b.hs:4:22: warning: [-Wpartial-type-signatures (in -Wdefault)] + • Found type wildcard ‘_’ standing for ‘Bool’ + • In the type ‘a -> _’ + In the type signature: h :: forall a. a -> _ + |