summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename
diff options
context:
space:
mode:
authorAndrei Borzenkov <andreyborzenkov2002@gmail.com>2023-01-23 19:43:29 +0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-01-28 02:59:18 -0500
commit50b1e2e8141fb1a3d1d3c1563935d08e90dca11a (patch)
tree99dda3c3e67265324312c8e8b2b4577b31b02809 /testsuite/tests/rename
parent082b7d43ee4b8203dc9bca53e5e1f7a45c42eeb8 (diff)
downloadhaskell-50b1e2e8141fb1a3d1d3c1563935d08e90dca11a.tar.gz
Convert diagnostics in GHC.Rename.Bind to proper TcRnMessage (#20115)
I removed all occurrences of TcRnUnknownMessage in GHC.Rename.Bind module. Instead, these TcRnMessage messages were introduced: TcRnMultipleFixityDecls TcRnIllegalPatternSynonymDecl TcRnIllegalClassBiding TcRnOrphanCompletePragma TcRnEmptyCase TcRnNonStdGuards TcRnDuplicateSigDecl TcRnMisplacedSigDecl TcRnUnexpectedDefaultSig TcRnBindInBootFile TcRnDuplicateMinimalSig
Diffstat (limited to 'testsuite/tests/rename')
-rw-r--r--testsuite/tests/rename/should_compile/rn049.stderr5
-rw-r--r--testsuite/tests/rename/should_fail/RnDefaultSigFail.hs6
-rw-r--r--testsuite/tests/rename/should_fail/RnDefaultSigFail.stderr4
-rw-r--r--testsuite/tests/rename/should_fail/RnEmptyCaseFail.hs14
-rw-r--r--testsuite/tests/rename/should_fail/RnEmptyCaseFail.stderr19
-rw-r--r--testsuite/tests/rename/should_fail/RnMultipleFixityFail.hs7
-rw-r--r--testsuite/tests/rename/should_fail/RnMultipleFixityFail.stderr4
-rw-r--r--testsuite/tests/rename/should_fail/RnMultipleMinimalPragmaFail.hs9
-rw-r--r--testsuite/tests/rename/should_fail/RnMultipleMinimalPragmaFail.stderr6
-rw-r--r--testsuite/tests/rename/should_fail/RnPatternSynonymFail.hs6
-rw-r--r--testsuite/tests/rename/should_fail/RnPatternSynonymFail.stderr4
-rw-r--r--testsuite/tests/rename/should_fail/T18138.stderr2
-rw-r--r--testsuite/tests/rename/should_fail/T19781.stderr4
-rw-r--r--testsuite/tests/rename/should_fail/T5589.stderr2
-rw-r--r--testsuite/tests/rename/should_fail/T7338.stderr2
-rw-r--r--testsuite/tests/rename/should_fail/T7338a.stderr4
-rw-r--r--testsuite/tests/rename/should_fail/all.T5
-rw-r--r--testsuite/tests/rename/should_fail/rnfail048.stderr2
18 files changed, 95 insertions, 10 deletions
diff --git a/testsuite/tests/rename/should_compile/rn049.stderr b/testsuite/tests/rename/should_compile/rn049.stderr
index 77df012628..5c13eb3936 100644
--- a/testsuite/tests/rename/should_compile/rn049.stderr
+++ b/testsuite/tests/rename/should_compile/rn049.stderr
@@ -1,4 +1,5 @@
-rn049.hs:12:6: Warning:
- accepting non-standard pattern guards (use PatternGuards to suppress this message)
+rn049.hs:12:6: warning: [GHC-59119]
+ accepting non-standard pattern guards
x <- 1 * 2 + 3 * 4
+ Suggested fix: Perhaps you intended to use PatternGuards
diff --git a/testsuite/tests/rename/should_fail/RnDefaultSigFail.hs b/testsuite/tests/rename/should_fail/RnDefaultSigFail.hs
new file mode 100644
index 0000000000..29a5f6a7e5
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/RnDefaultSigFail.hs
@@ -0,0 +1,6 @@
+module RnDefaultSigFail where
+
+class C a where
+ m :: a
+ default m :: Num a => a
+ m = 0
diff --git a/testsuite/tests/rename/should_fail/RnDefaultSigFail.stderr b/testsuite/tests/rename/should_fail/RnDefaultSigFail.stderr
new file mode 100644
index 0000000000..fa58838e88
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/RnDefaultSigFail.stderr
@@ -0,0 +1,4 @@
+
+RnDefaultSigFail.hs:5:3: error: [GHC-40700]
+ Unexpected default signature: default m :: Num a => a
+ Suggested fix: Perhaps you intended to use DefaultSignatures
diff --git a/testsuite/tests/rename/should_fail/RnEmptyCaseFail.hs b/testsuite/tests/rename/should_fail/RnEmptyCaseFail.hs
new file mode 100644
index 0000000000..4ba8082d6c
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/RnEmptyCaseFail.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE NoEmptyCase #-}
+{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE Arrows #-}
+module RnEmptyCaseFail where
+
+f = case () of
+
+g = \case
+
+h = \cases
+
+j = proc x -> do \case
+
+k = proc x -> do case () of
diff --git a/testsuite/tests/rename/should_fail/RnEmptyCaseFail.stderr b/testsuite/tests/rename/should_fail/RnEmptyCaseFail.stderr
new file mode 100644
index 0000000000..d611567a6e
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/RnEmptyCaseFail.stderr
@@ -0,0 +1,19 @@
+
+RnEmptyCaseFail.hs:6:5: error: [GHC-48010]
+ Empty list of alternatives in case expression
+ Suggested fix: Perhaps you intended to use EmptyCase
+
+RnEmptyCaseFail.hs:8:5: error: [GHC-48010]
+ Empty list of alternatives in \case expression
+ Suggested fix: Perhaps you intended to use EmptyCase
+
+RnEmptyCaseFail.hs:10:5: error: [GHC-48010]
+ Empty list of alternatives is not allowed in \cases expression
+
+RnEmptyCaseFail.hs:12:18: error: [GHC-48010]
+ Empty list of alternatives in \case command
+ Suggested fix: Perhaps you intended to use EmptyCase
+
+RnEmptyCaseFail.hs:14:18: error: [GHC-48010]
+ Empty list of alternatives in case command
+ Suggested fix: Perhaps you intended to use EmptyCase
diff --git a/testsuite/tests/rename/should_fail/RnMultipleFixityFail.hs b/testsuite/tests/rename/should_fail/RnMultipleFixityFail.hs
new file mode 100644
index 0000000000..039e6151a7
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/RnMultipleFixityFail.hs
@@ -0,0 +1,7 @@
+module RnMultipleFixityFail where
+
+
+($$) = ($)
+
+infixr 4 $$
+infixl 6 $$
diff --git a/testsuite/tests/rename/should_fail/RnMultipleFixityFail.stderr b/testsuite/tests/rename/should_fail/RnMultipleFixityFail.stderr
new file mode 100644
index 0000000000..73c3314a2e
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/RnMultipleFixityFail.stderr
@@ -0,0 +1,4 @@
+
+RnMultipleFixityFail.hs:6:10: error: [GHC-50419]
+ Multiple fixity declarations for ‘$$’
+ also at RnMultipleFixityFail.hs:7:1-11
diff --git a/testsuite/tests/rename/should_fail/RnMultipleMinimalPragmaFail.hs b/testsuite/tests/rename/should_fail/RnMultipleMinimalPragmaFail.hs
new file mode 100644
index 0000000000..b28a6b4a6b
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/RnMultipleMinimalPragmaFail.hs
@@ -0,0 +1,9 @@
+module RnMultipleMinimalPragmaFail where
+
+class C a where
+ {-# MINIMAL m1 | m2 #-}
+ m1 :: a
+ m2 :: a
+ m2 = m1
+ m1 = m2
+ {-# MINIMAL m1 | m2 #-}
diff --git a/testsuite/tests/rename/should_fail/RnMultipleMinimalPragmaFail.stderr b/testsuite/tests/rename/should_fail/RnMultipleMinimalPragmaFail.stderr
new file mode 100644
index 0000000000..b613af6206
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/RnMultipleMinimalPragmaFail.stderr
@@ -0,0 +1,6 @@
+
+RnMultipleMinimalPragmaFail.hs:4:3: error: [GHC-85346]
+ Multiple minimal complete definitions
+ at RnMultipleMinimalPragmaFail.hs:4:3-25
+ RnMultipleMinimalPragmaFail.hs:9:3-25
+ Combine alternative minimal complete definitions with `|'
diff --git a/testsuite/tests/rename/should_fail/RnPatternSynonymFail.hs b/testsuite/tests/rename/should_fail/RnPatternSynonymFail.hs
new file mode 100644
index 0000000000..fd3c06e02c
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/RnPatternSynonymFail.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE TemplateHaskell #-}
+module RnPatternSynonymFail where
+
+import Language.Haskell.TH
+
+$(pure [ PatSynD (mkName "None") (PrefixPatSyn []) ImplBidir (ConP 'Nothing [] [])])
diff --git a/testsuite/tests/rename/should_fail/RnPatternSynonymFail.stderr b/testsuite/tests/rename/should_fail/RnPatternSynonymFail.stderr
new file mode 100644
index 0000000000..0bf8f16f04
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/RnPatternSynonymFail.stderr
@@ -0,0 +1,4 @@
+
+RnPatternSynonymFail.hs:6:2: error: [GHC-41507]
+ Illegal pattern synonym declaration
+ Suggested fix: Perhaps you intended to use PatternSynonyms
diff --git a/testsuite/tests/rename/should_fail/T18138.stderr b/testsuite/tests/rename/should_fail/T18138.stderr
index dea2871a51..afd11678f1 100644
--- a/testsuite/tests/rename/should_fail/T18138.stderr
+++ b/testsuite/tests/rename/should_fail/T18138.stderr
@@ -1,4 +1,4 @@
-T18138.hs:4:1: error:
+T18138.hs:4:1: error: [GHC-87866]
Misplaced SPECIALISE instance pragma:
{-# SPECIALISE instance Eq (T Int) #-}
diff --git a/testsuite/tests/rename/should_fail/T19781.stderr b/testsuite/tests/rename/should_fail/T19781.stderr
index 1e468715aa..ffe4a4d329 100644
--- a/testsuite/tests/rename/should_fail/T19781.stderr
+++ b/testsuite/tests/rename/should_fail/T19781.stderr
@@ -1,6 +1,6 @@
-T19781_A.hs-boot:4:1: error:
+T19781_A.hs-boot:4:1: error: [GHC-11247]
Bindings in hs-boot files are not allowed
-T19781_A.hs-boot:7:1: error:
+T19781_A.hs-boot:7:1: error: [GHC-11247]
Bindings in hs-boot files are not allowed
diff --git a/testsuite/tests/rename/should_fail/T5589.stderr b/testsuite/tests/rename/should_fail/T5589.stderr
index f3e5e8d05c..591a51dc74 100644
--- a/testsuite/tests/rename/should_fail/T5589.stderr
+++ b/testsuite/tests/rename/should_fail/T5589.stderr
@@ -1,5 +1,5 @@
-T5589.hs:4:1:
+T5589.hs:4:1: error: [GHC-31744]
Duplicate type signatures for ‘aaa’
at T5589.hs:3:6-8
T5589.hs:4:1-3
diff --git a/testsuite/tests/rename/should_fail/T7338.stderr b/testsuite/tests/rename/should_fail/T7338.stderr
index ceb6753a22..138d1f2838 100644
--- a/testsuite/tests/rename/should_fail/T7338.stderr
+++ b/testsuite/tests/rename/should_fail/T7338.stderr
@@ -1,5 +1,5 @@
-T7338.hs:4:1:
+T7338.hs:4:1: error: [GHC-31744]
Duplicate type signatures for ‘a’
at T7338.hs:3:1
T7338.hs:3:4
diff --git a/testsuite/tests/rename/should_fail/T7338a.stderr b/testsuite/tests/rename/should_fail/T7338a.stderr
index 8d6d00097c..01acd0582b 100644
--- a/testsuite/tests/rename/should_fail/T7338a.stderr
+++ b/testsuite/tests/rename/should_fail/T7338a.stderr
@@ -1,10 +1,10 @@
-T7338a.hs:7:4:
+T7338a.hs:7:4: error: [GHC-31744]
Duplicate type signatures for ‘a’
at T7338a.hs:3:1
T7338a.hs:7:4
-T7338a.hs:10:1:
+T7338a.hs:10:1: error: [GHC-31744]
Duplicate type signatures for ‘c’
at T7338a.hs:7:1
T7338a.hs:10:1
diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T
index c25ba747e7..eee582db2b 100644
--- a/testsuite/tests/rename/should_fail/all.T
+++ b/testsuite/tests/rename/should_fail/all.T
@@ -184,3 +184,8 @@ test('T21605b', normal, compile_fail, [''])
test('T21605c', normal, compile_fail, [''])
test('T21605d', normal, compile_fail, [''])
test('T22839', normal, compile_fail, [''])
+test('RnPatternSynonymFail', normal, compile_fail, [''])
+test('RnMultipleFixityFail', normal, compile_fail, [''])
+test('RnEmptyCaseFail', normal, compile_fail, [''])
+test('RnDefaultSigFail', normal, compile_fail, [''])
+test('RnMultipleMinimalPragmaFail', normal, compile_fail, [''])
diff --git a/testsuite/tests/rename/should_fail/rnfail048.stderr b/testsuite/tests/rename/should_fail/rnfail048.stderr
index 64955c3982..bd616596b2 100644
--- a/testsuite/tests/rename/should_fail/rnfail048.stderr
+++ b/testsuite/tests/rename/should_fail/rnfail048.stderr
@@ -1,5 +1,5 @@
-rnfail048.hs:11:12:
+rnfail048.hs:11:12: error: [GHC-31744]
Duplicate INLINE pragmas for ‘foo’
at rnfail048.hs:6:17-19
rnfail048.hs:7:18-20