diff options
author | Giles Anderson <agander@gmail.com> | 2022-07-09 21:25:35 +0200 |
---|---|---|
committer | Giles Anderson <agander@gmail.com> | 2022-08-29 00:01:35 +0200 |
commit | 68e6786f3d1bde5d044a649462cdf2b6034a2df8 (patch) | |
tree | bfed2de821fe4432480081ff0203b5e518dc0ebb /testsuite | |
parent | 161a6f1fd62e797e978e7808a5f567fefa123f16 (diff) | |
download | haskell-68e6786f3d1bde5d044a649462cdf2b6034a2df8.tar.gz |
Use TcRnDiagnostic in GHC.Tc.TyCl.Class (#20117)
The following `TcRnDiagnostic` messages have been introduced:
TcRnIllegalHsigDefaultMethods
TcRnBadGenericMethod
TcRnWarningMinimalDefIncomplete
TcRnDefaultMethodForPragmaLacksBinding
TcRnIgnoreSpecialisePragmaOnDefMethod
TcRnBadMethodErr
TcRnNoExplicitAssocTypeOrDefaultDeclaration
Diffstat (limited to 'testsuite')
4 files changed, 13 insertions, 1 deletions
diff --git a/testsuite/tests/backpack/should_fail/bkpfail40.stderr b/testsuite/tests/backpack/should_fail/bkpfail40.stderr index a2f36dfa8e..f221afc7ba 100644 --- a/testsuite/tests/backpack/should_fail/bkpfail40.stderr +++ b/testsuite/tests/backpack/should_fail/bkpfail40.stderr @@ -2,5 +2,5 @@ [1 of 1] Compiling A[sig] ( p/A.hsig, nothing ) bkpfail40.bkp:3:9: error: - • Illegal default method(s) in class definition of C in hsig file + • Illegal default method in class definition of C in hsig file • In the class declaration for ‘C’ diff --git a/testsuite/tests/typecheck/should_fail/MissingDefaultMethodBinding.hs b/testsuite/tests/typecheck/should_fail/MissingDefaultMethodBinding.hs new file mode 100644 index 0000000000..6ee4c70691 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/MissingDefaultMethodBinding.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE DefaultSignatures #-} + +module MissingDefaultMethodBinding where + +class C a where + meth :: a + default meth :: Num a => a diff --git a/testsuite/tests/typecheck/should_fail/MissingDefaultMethodBinding.stderr b/testsuite/tests/typecheck/should_fail/MissingDefaultMethodBinding.stderr new file mode 100644 index 0000000000..fe752862c1 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/MissingDefaultMethodBinding.stderr @@ -0,0 +1,4 @@ + +MissingDefaultMethodBinding.hs:5:1: + Class ‘C’ has a generic-default signature without a binding ‘meth’ + In the class declaration for ‘C’ diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 2674798823..51d73be7ed 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -658,3 +658,4 @@ test('T21327', normal, compile_fail, ['']) test('T21338', normal, compile_fail, ['']) test('T21158', normal, compile_fail, ['']) test('T21583', normal, compile_fail, ['']) +test('MissingDefaultMethodBinding', normal, compile_fail, ['']) |