summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorAlfredo Di Napoli <alfredo@well-typed.com>2021-07-14 08:50:22 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-21 02:46:13 -0400
commit06d1ca856d3374bf8dac952740cfe4cef76a350d (patch)
treeb9ae2c342dca4457445b3da4dc30730043791ff3 /testsuite/tests
parent9eb1641e0ef10a7887e794d4d114c9a18a2fd265 (diff)
downloadhaskell-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')
-rw-r--r--testsuite/tests/dependent/should_fail/T16326_Fail7.stderr5
-rw-r--r--testsuite/tests/numeric/should_compile/T8542.stderr3
-rw-r--r--testsuite/tests/parser/should_fail/ParserNoForallUnicode.stderr5
-rw-r--r--testsuite/tests/parser/should_fail/T16270.stderr8
-rw-r--r--testsuite/tests/parser/should_fail/T3095.stderr5
-rw-r--r--testsuite/tests/parser/should_fail/T8258NoGADTs.stderr5
-rw-r--r--testsuite/tests/rename/should_fail/rnfail052.stderr15
-rw-r--r--testsuite/tests/typecheck/should_fail/T3155.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail166.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail183.stderr5
10 files changed, 36 insertions, 25 deletions
diff --git a/testsuite/tests/dependent/should_fail/T16326_Fail7.stderr b/testsuite/tests/dependent/should_fail/T16326_Fail7.stderr
index c5aba0b06d..edb1c1c8f5 100644
--- a/testsuite/tests/dependent/should_fail/T16326_Fail7.stderr
+++ b/testsuite/tests/dependent/should_fail/T16326_Fail7.stderr
@@ -1,5 +1,6 @@
T16326_Fail7.hs:9:13: error:
Illegal symbol ‘forall’ in type
- Perhaps you intended to use RankNTypes or a similar language
- extension to enable explicit-forall syntax: forall <tvs>. <type>
+ Suggested fix:
+ Perhaps you intended to use RankNTypes
+ or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type>
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
diff --git a/testsuite/tests/parser/should_fail/ParserNoForallUnicode.stderr b/testsuite/tests/parser/should_fail/ParserNoForallUnicode.stderr
index 81286aa49d..0d8841c676 100644
--- a/testsuite/tests/parser/should_fail/ParserNoForallUnicode.stderr
+++ b/testsuite/tests/parser/should_fail/ParserNoForallUnicode.stderr
@@ -1,5 +1,6 @@
ParserNoForallUnicode.hs:6:8: error:
Illegal symbol ‘∀’ in type
- Perhaps you intended to use RankNTypes or a similar language
- extension to enable explicit-forall syntax: ∀ <tvs>. <type>
+ Suggested fix:
+ Perhaps you intended to use RankNTypes
+ or a similar language extension to enable explicit-forall syntax: ∀ <tvs>. <type>
diff --git a/testsuite/tests/parser/should_fail/T16270.stderr b/testsuite/tests/parser/should_fail/T16270.stderr
index 578add9682..e928638539 100644
--- a/testsuite/tests/parser/should_fail/T16270.stderr
+++ b/testsuite/tests/parser/should_fail/T16270.stderr
@@ -37,8 +37,8 @@ T16270.hs:19:5: error:
T16270.hs:21:6: error:
Illegal symbol ‘forall’ in type
- Perhaps you intended to use RankNTypes or a similar language
- extension to enable explicit-forall syntax: forall <tvs>. <type>
+ Suggested fix: Perhaps you intended to use RankNTypes
+ or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type>
T16270.hs:22:8: error:
Unexpected semi-colons in conditional:
@@ -47,8 +47,8 @@ T16270.hs:22:8: error:
T16270.hs:24:10: error:
Illegal keyword 'where' in data declaration
- Perhaps you intended to use GADTs or a similar language
- extension to enable syntax: data T where
+ Suggested fix: Perhaps you intended to use GADTs
+ or a similar language extension to enable syntax: data T where
T16270.hs:26:12: error:
Illegal bang-pattern
diff --git a/testsuite/tests/parser/should_fail/T3095.stderr b/testsuite/tests/parser/should_fail/T3095.stderr
index 599579deb0..ebb42b5be1 100644
--- a/testsuite/tests/parser/should_fail/T3095.stderr
+++ b/testsuite/tests/parser/should_fail/T3095.stderr
@@ -1,8 +1,9 @@
T3095.hs:8:12: error:
Illegal symbol ‘forall’ in type
- Perhaps you intended to use RankNTypes or a similar language
- extension to enable explicit-forall syntax: forall <tvs>. <type>
+ Suggested fix:
+ Perhaps you intended to use RankNTypes
+ or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type>
T3095.hs:8:12: error:
Unexpected type ‘forall x. x :: Type’
diff --git a/testsuite/tests/parser/should_fail/T8258NoGADTs.stderr b/testsuite/tests/parser/should_fail/T8258NoGADTs.stderr
index ecf3f7e11b..8e0cce6f54 100644
--- a/testsuite/tests/parser/should_fail/T8258NoGADTs.stderr
+++ b/testsuite/tests/parser/should_fail/T8258NoGADTs.stderr
@@ -1,5 +1,6 @@
T8258NoGADTs.hs:4:8: error:
Illegal keyword 'where' in data declaration
- Perhaps you intended to use GADTs or a similar language
- extension to enable syntax: data T where
+ Suggested fix:
+ Perhaps you intended to use GADTs
+ or a similar language extension to enable syntax: data T where
diff --git a/testsuite/tests/rename/should_fail/rnfail052.stderr b/testsuite/tests/rename/should_fail/rnfail052.stderr
index b818a4b6be..242fb70fd6 100644
--- a/testsuite/tests/rename/should_fail/rnfail052.stderr
+++ b/testsuite/tests/rename/should_fail/rnfail052.stderr
@@ -1,15 +1,18 @@
rnfail052.hs:7:6: error:
Illegal symbol ‘forall’ in type
- Perhaps you intended to use RankNTypes or a similar language
- extension to enable explicit-forall syntax: forall <tvs>. <type>
+ Suggested fix:
+ Perhaps you intended to use RankNTypes
+ or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type>
rnfail052.hs:10:14: error:
Illegal symbol ‘forall’ in type
- Perhaps you intended to use RankNTypes or a similar language
- extension to enable explicit-forall syntax: forall <tvs>. <type>
+ Suggested fix:
+ Perhaps you intended to use RankNTypes
+ or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type>
rnfail052.hs:13:15: error:
Illegal symbol ‘forall’ in type
- Perhaps you intended to use RankNTypes or a similar language
- extension to enable explicit-forall syntax: forall <tvs>. <type>
+ Suggested fix:
+ Perhaps you intended to use RankNTypes
+ or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type>
diff --git a/testsuite/tests/typecheck/should_fail/T3155.stderr b/testsuite/tests/typecheck/should_fail/T3155.stderr
index e82803fd22..ed7c4160e2 100644
--- a/testsuite/tests/typecheck/should_fail/T3155.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3155.stderr
@@ -1,5 +1,6 @@
T3155.hs:14:9: error:
Illegal symbol ‘forall’ in type
- Perhaps you intended to use RankNTypes or a similar language
- extension to enable explicit-forall syntax: forall <tvs>. <type>
+ Suggested fix:
+ Perhaps you intended to use RankNTypes
+ or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type>
diff --git a/testsuite/tests/typecheck/should_fail/tcfail166.stderr b/testsuite/tests/typecheck/should_fail/tcfail166.stderr
index ab8805183d..5866cacd77 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail166.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail166.stderr
@@ -1,5 +1,6 @@
tcfail166.hs:6:13: error:
Illegal symbol ‘forall’ in type
- Perhaps you intended to use RankNTypes or a similar language
- extension to enable explicit-forall syntax: forall <tvs>. <type>
+ Suggested fix:
+ Perhaps you intended to use RankNTypes
+ or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type>
diff --git a/testsuite/tests/typecheck/should_fail/tcfail183.stderr b/testsuite/tests/typecheck/should_fail/tcfail183.stderr
index 96245ce100..fc6fcfdcac 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail183.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail183.stderr
@@ -1,5 +1,6 @@
tcfail183.hs:5:30: error:
Illegal symbol ‘forall’ in type
- Perhaps you intended to use RankNTypes or a similar language
- extension to enable explicit-forall syntax: forall <tvs>. <type>
+ Suggested fix:
+ Perhaps you intended to use RankNTypes
+ or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type>