diff options
author | Giles Anderson <agander@gmail.com> | 2022-08-29 23:01:47 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-11-09 09:27:52 -0500 |
commit | 92ccb8de9624ea930d66152b2f6a181941a497c9 (patch) | |
tree | 6231d4f2c6a7e4e60a18f7d9f128ffab1e0ffe10 /testsuite/tests/indexed-types | |
parent | 080fffa1015bcc0cff8ab4ad1eeb507fb7a13383 (diff) | |
download | haskell-92ccb8de9624ea930d66152b2f6a181941a497c9.tar.gz |
Use TcRnDiagnostic in GHC.Tc.TyCl.Instance (#20117)
The following `TcRnDiagnostic` messages have been introduced:
TcRnWarnUnsatisfiedMinimalDefinition
TcRnMisplacedInstSig
TcRnBadBootFamInstDeclErr
TcRnIllegalFamilyInstance
TcRnAssocInClassErr
TcRnBadFamInstDecl
TcRnNotOpenFamily
Diffstat (limited to 'testsuite/tests/indexed-types')
15 files changed, 47 insertions, 10 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/Class3.stderr b/testsuite/tests/indexed-types/should_compile/Class3.stderr index 86aa24c69d..122279b449 100644 --- a/testsuite/tests/indexed-types/should_compile/Class3.stderr +++ b/testsuite/tests/indexed-types/should_compile/Class3.stderr @@ -1,5 +1,5 @@ -Class3.hs:7:10: warning: [-Wmissing-methods (in -Wdefault)] +Class3.hs:7:10: warning: [GHC-06201] [-Wmissing-methods (in -Wdefault)] • No explicit implementation for ‘foo’ • In the instance declaration for ‘C ()’ diff --git a/testsuite/tests/indexed-types/should_compile/Simple2.stderr b/testsuite/tests/indexed-types/should_compile/Simple2.stderr index 70d825dbf6..530469bab3 100644 --- a/testsuite/tests/indexed-types/should_compile/Simple2.stderr +++ b/testsuite/tests/indexed-types/should_compile/Simple2.stderr @@ -3,7 +3,7 @@ Simple2.hs:21:1: warning: [GHC-08585] [-Wmissing-methods (in -Wdefault)] • No explicit associated type or default declaration for ‘S3n’ • In the instance declaration for ‘C3 Char’ -Simple2.hs:21:10: warning: [-Wmissing-methods (in -Wdefault)] +Simple2.hs:21:10: warning: [GHC-06201] [-Wmissing-methods (in -Wdefault)] • No explicit implementation for ‘foo3n’ and ‘bar3n’ • In the instance declaration for ‘C3 Char’ @@ -12,7 +12,7 @@ Simple2.hs:29:1: warning: [GHC-08585] [-Wmissing-methods (in -Wdefault)] • No explicit associated type or default declaration for ‘S3n’ • In the instance declaration for ‘C3 Bool’ -Simple2.hs:29:10: warning: [-Wmissing-methods (in -Wdefault)] +Simple2.hs:29:10: warning: [GHC-06201] [-Wmissing-methods (in -Wdefault)] • No explicit implementation for ‘foo3n’ and ‘bar3n’ • In the instance declaration for ‘C3 Bool’ @@ -25,7 +25,7 @@ Simple2.hs:39:1: warning: [GHC-08585] [-Wmissing-methods (in -Wdefault)] • No explicit associated type or default declaration for ‘S3’ • In the instance declaration for ‘C3 Float’ -Simple2.hs:39:10: warning: [-Wmissing-methods (in -Wdefault)] +Simple2.hs:39:10: warning: [GHC-06201] [-Wmissing-methods (in -Wdefault)] • No explicit implementation for ‘foo3n’ and ‘bar3n’ • In the instance declaration for ‘C3 Float’ diff --git a/testsuite/tests/indexed-types/should_fail/BadFamInstDecl.hs b/testsuite/tests/indexed-types/should_fail/BadFamInstDecl.hs new file mode 100644 index 0000000000..ab894db1b1 --- /dev/null +++ b/testsuite/tests/indexed-types/should_fail/BadFamInstDecl.hs @@ -0,0 +1,4 @@ +module BadFamInstDecl where +import BadFamInstDecl_aux + +type instance T Int = Char diff --git a/testsuite/tests/indexed-types/should_fail/BadFamInstDecl.stderr b/testsuite/tests/indexed-types/should_fail/BadFamInstDecl.stderr new file mode 100644 index 0000000000..8b87a97cba --- /dev/null +++ b/testsuite/tests/indexed-types/should_fail/BadFamInstDecl.stderr @@ -0,0 +1,7 @@ +[1 of 2] Compiling BadFamInstDecl_aux ( BadFamInstDecl_aux.hs, BadFamInstDecl_aux.o ) +[2 of 2] Compiling BadFamInstDecl ( BadFamInstDecl.hs, BadFamInstDecl.o ) + +BadFamInstDecl.hs:4:1: [GHC-06206] + Illegal family instance for ‘T’ + In the type instance declaration for ‘T’ + Suggested fix: Perhaps you intended to use TypeFamilies diff --git a/testsuite/tests/indexed-types/should_fail/BadFamInstDecl_aux.hs b/testsuite/tests/indexed-types/should_fail/BadFamInstDecl_aux.hs new file mode 100644 index 0000000000..09f1873a44 --- /dev/null +++ b/testsuite/tests/indexed-types/should_fail/BadFamInstDecl_aux.hs @@ -0,0 +1,4 @@ +{-# LANGUAGE TypeFamilies #-} +module BadFamInstDecl_aux where + +type family T a diff --git a/testsuite/tests/indexed-types/should_fail/HsBootFam.hs b/testsuite/tests/indexed-types/should_fail/HsBootFam.hs new file mode 100644 index 0000000000..0fbae41933 --- /dev/null +++ b/testsuite/tests/indexed-types/should_fail/HsBootFam.hs @@ -0,0 +1,3 @@ +module HsBootFam where + +import {-# SOURCE #-} HsBootFam_aux diff --git a/testsuite/tests/indexed-types/should_fail/HsBootFam.stderr b/testsuite/tests/indexed-types/should_fail/HsBootFam.stderr new file mode 100644 index 0000000000..a6950a3ade --- /dev/null +++ b/testsuite/tests/indexed-types/should_fail/HsBootFam.stderr @@ -0,0 +1,5 @@ +[1 of 3] Compiling HsBootFam_aux[boot] ( HsBootFam_aux.hs-boot, HsBootFam_aux.o-boot ) + +HsBootFam_aux.hs-boot:6:1: [GHC-06203] + Illegal family instance in hs-boot file + In the type instance declaration for ‘F’ diff --git a/testsuite/tests/indexed-types/should_fail/HsBootFam_aux.hs b/testsuite/tests/indexed-types/should_fail/HsBootFam_aux.hs new file mode 100644 index 0000000000..d74cda5e7a --- /dev/null +++ b/testsuite/tests/indexed-types/should_fail/HsBootFam_aux.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE TypeFamilies #-} + +module HsBootFam_aux where + +type family F a +type instance F Int = Char diff --git a/testsuite/tests/indexed-types/should_fail/HsBootFam_aux.hs-boot b/testsuite/tests/indexed-types/should_fail/HsBootFam_aux.hs-boot new file mode 100644 index 0000000000..d74cda5e7a --- /dev/null +++ b/testsuite/tests/indexed-types/should_fail/HsBootFam_aux.hs-boot @@ -0,0 +1,6 @@ +{-# LANGUAGE TypeFamilies #-} + +module HsBootFam_aux where + +type family F a +type instance F Int = Char diff --git a/testsuite/tests/indexed-types/should_fail/Overlap3.stderr b/testsuite/tests/indexed-types/should_fail/Overlap3.stderr index 5659fd1875..144ce6c020 100644 --- a/testsuite/tests/indexed-types/should_fail/Overlap3.stderr +++ b/testsuite/tests/indexed-types/should_fail/Overlap3.stderr @@ -1,4 +1,4 @@ -Overlap3.hs:8:1: +Overlap3.hs:8:1: [GHC-06207] Illegal instance for closed family ‘F’ In the type instance declaration for ‘F’ diff --git a/testsuite/tests/indexed-types/should_fail/Overlap7.stderr b/testsuite/tests/indexed-types/should_fail/Overlap7.stderr index 179251d5a2..04f765f495 100644 --- a/testsuite/tests/indexed-types/should_fail/Overlap7.stderr +++ b/testsuite/tests/indexed-types/should_fail/Overlap7.stderr @@ -1,4 +1,4 @@ -Overlap7.hs:8:1: +Overlap7.hs:8:1: [GHC-06207] Illegal instance for closed family ‘F’ In the type instance declaration for ‘F’ diff --git a/testsuite/tests/indexed-types/should_fail/SimpleFail7.stderr b/testsuite/tests/indexed-types/should_fail/SimpleFail7.stderr index 643709ec7e..1cd89db629 100644 --- a/testsuite/tests/indexed-types/should_fail/SimpleFail7.stderr +++ b/testsuite/tests/indexed-types/should_fail/SimpleFail7.stderr @@ -1,4 +1,4 @@ -SimpleFail7.hs:8:1: +SimpleFail7.hs:8:1: [GHC-06205] Associated type ‘S5’ must be inside a class instance In the data instance declaration for ‘S5’ diff --git a/testsuite/tests/indexed-types/should_fail/T3092.stderr b/testsuite/tests/indexed-types/should_fail/T3092.stderr index 141945c781..4754b3326f 100644 --- a/testsuite/tests/indexed-types/should_fail/T3092.stderr +++ b/testsuite/tests/indexed-types/should_fail/T3092.stderr @@ -1,10 +1,10 @@ -T3092.hs:5:1: +T3092.hs:5:1: [GHC-06204] Illegal family instance for ‘T’ (T is not an indexed type family) In the data instance declaration for ‘T’ -T3092.hs:8:1: +T3092.hs:8:1: [GHC-06204] Illegal family instance for ‘S’ (S is not an indexed type family) In the type instance declaration for ‘S’ diff --git a/testsuite/tests/indexed-types/should_fail/T7862.stderr b/testsuite/tests/indexed-types/should_fail/T7862.stderr index d430310aa9..a625b56098 100644 --- a/testsuite/tests/indexed-types/should_fail/T7862.stderr +++ b/testsuite/tests/indexed-types/should_fail/T7862.stderr @@ -1,5 +1,5 @@ -T7862.hs:23:10: warning: [-Wmissing-methods (in -Wdefault)] +T7862.hs:23:10: warning: [GHC-06201] [-Wmissing-methods (in -Wdefault)] • No explicit implementation for ‘+’, ‘*’, ‘abs’, ‘signum’, ‘fromInteger’, and (either ‘negate’ or diff --git a/testsuite/tests/indexed-types/should_fail/all.T b/testsuite/tests/indexed-types/should_fail/all.T index c056a1e056..e990d572c0 100644 --- a/testsuite/tests/indexed-types/should_fail/all.T +++ b/testsuite/tests/indexed-types/should_fail/all.T @@ -169,3 +169,5 @@ test('ExpandTFs', normal, compile_fail, ['']) test('T20465', normal, compile_fail, ['']) test('T20521', normal, compile_fail, ['']) test('T21896', normal, compile_fail, ['']) +test('HsBootFam', [extra_files(['HsBootFam_aux.hs','HsBootFam_aux.hs-boot'])], multimod_compile_fail, ['HsBootFam', '']) +test('BadFamInstDecl', [extra_files(['BadFamInstDecl_aux.hs'])], multimod_compile_fail, ['BadFamInstDecl', '']) |