diff options
author | Alfredo Di Napoli <alfredo@well-typed.com> | 2021-07-14 08:50:22 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-07-21 02:46:13 -0400 |
commit | 06d1ca856d3374bf8dac952740cfe4cef76a350d (patch) | |
tree | b9ae2c342dca4457445b3da4dc30730043791ff3 /testsuite/tests/numeric | |
parent | 9eb1641e0ef10a7887e794d4d114c9a18a2fd265 (diff) | |
download | haskell-06d1ca856d3374bf8dac952740cfe4cef76a350d.tar.gz |
Refactor SuggestExtension constructor in GhcHint
This commit refactors the SuggestExtension type constructor of the
GhcHint to be more powerful and flexible. In particular, we can now
embed extra user information (essentially "sugar") to help clarifying
the suggestion. This makes the following possible:
Suggested fix: Perhaps you intended to use GADTs
or a similar language extension to enable syntax: data T where
We can still give to IDEs and tools a `LangExt.Extension` they can use,
but in the pretty-printed message we can tell the user a bit more on why
such extension is needed.
On top of that, we now have the ability to express conjuctions and
disjunctons, for those cases where GHC suggests to enable "X or Y" and
for the cases where we need "X and Y".
Diffstat (limited to 'testsuite/tests/numeric')
-rw-r--r-- | testsuite/tests/numeric/should_compile/T8542.stderr | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/testsuite/tests/numeric/should_compile/T8542.stderr b/testsuite/tests/numeric/should_compile/T8542.stderr index fb6ddf7a72..2d12b9fd7f 100644 --- a/testsuite/tests/numeric/should_compile/T8542.stderr +++ b/testsuite/tests/numeric/should_compile/T8542.stderr @@ -2,4 +2,5 @@ T8542.hs:9:5: warning: [-Woverflowed-literals (in -Wdefault)] Literal 128 is out of the Int8 range -128..127 Suggested fix: - If you are trying to write a large negative literal, use NegativeLiterals + Perhaps you intended to use NegativeLiterals + If you are trying to write a large negative literal |