diff options
Diffstat (limited to 'testsuite')
10 files changed, 36 insertions, 3 deletions
diff --git a/testsuite/tests/patsyn/should_fail/T14112.stderr b/testsuite/tests/patsyn/should_fail/T14112.stderr index bd0b9543af..833eee188b 100644 --- a/testsuite/tests/patsyn/should_fail/T14112.stderr +++ b/testsuite/tests/patsyn/should_fail/T14112.stderr @@ -1,5 +1,5 @@ -T14112.hs:5:21: error: +T14112.hs:5:21: error: [GHC-69317] Invalid right-hand side of bidirectional pattern synonym ‘MyJust1’: Pattern ‘!a’ is not invertible Suggestion: instead use an explicitly bidirectional pattern synonym, e.g. diff --git a/testsuite/tests/patsyn/should_fail/T14507.stderr b/testsuite/tests/patsyn/should_fail/T14507.stderr index d3dfa0a04f..85c42b8771 100644 --- a/testsuite/tests/patsyn/should_fail/T14507.stderr +++ b/testsuite/tests/patsyn/should_fail/T14507.stderr @@ -1,5 +1,5 @@ -T14507.hs:21:1: error: +T14507.hs:21:1: error: [GHC-88986] • Iceland Jack! Iceland Jack! Stop torturing me! Pattern-bound variable x :: TypeRep a has a type that mentions pattern-bound coercion: co diff --git a/testsuite/tests/patsyn/should_fail/unidir.stderr b/testsuite/tests/patsyn/should_fail/unidir.stderr index ba3799d201..649dc9cf05 100644 --- a/testsuite/tests/patsyn/should_fail/unidir.stderr +++ b/testsuite/tests/patsyn/should_fail/unidir.stderr @@ -1,5 +1,5 @@ -unidir.hs:4:18: error: +unidir.hs:4:18: error: [GHC-69317] Invalid right-hand side of bidirectional pattern synonym ‘Head’: Pattern ‘_’ is not invertible Suggestion: instead use an explicitly bidirectional pattern synonym, e.g. diff --git a/testsuite/tests/typecheck/should_fail/PatSynArity.hs b/testsuite/tests/typecheck/should_fail/PatSynArity.hs new file mode 100644 index 0000000000..4f09dbdcc7 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/PatSynArity.hs @@ -0,0 +1,6 @@ +{-# language PatternSynonyms #-} + +module PatSynArity where + +pattern P :: Int -> (Int, Int) +pattern P a b = (a, b) diff --git a/testsuite/tests/typecheck/should_fail/PatSynArity.stderr b/testsuite/tests/typecheck/should_fail/PatSynArity.stderr new file mode 100644 index 0000000000..502255ad4b --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/PatSynArity.stderr @@ -0,0 +1,4 @@ +PatSynArity.hs:6:1: [GHC-18365] + Pattern synonym ‘P’ has two arguments + but its type signature has 1 fewer arrows + In the declaration for pattern synonym ‘P’ diff --git a/testsuite/tests/typecheck/should_fail/PatSynExistential.hs b/testsuite/tests/typecheck/should_fail/PatSynExistential.hs new file mode 100644 index 0000000000..ddfaa2ad16 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/PatSynExistential.hs @@ -0,0 +1,6 @@ +{-# language PatternSynonyms #-} + +module PatSynExistential where + +pattern P :: () => forall x. x -> Maybe x +pattern P <- _ diff --git a/testsuite/tests/typecheck/should_fail/PatSynExistential.stderr b/testsuite/tests/typecheck/should_fail/PatSynExistential.stderr new file mode 100644 index 0000000000..326974dc55 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/PatSynExistential.stderr @@ -0,0 +1,4 @@ +PatSynExistential.hs:6:1: [GHC-33973] + The result type of the signature for ‘P’, namely ‘x -> Maybe x’ + mentions existential type variable ‘x’ + In the declaration for pattern synonym ‘P’ diff --git a/testsuite/tests/typecheck/should_fail/PatSynUnboundVar.hs b/testsuite/tests/typecheck/should_fail/PatSynUnboundVar.hs new file mode 100644 index 0000000000..961713096a --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/PatSynUnboundVar.hs @@ -0,0 +1,6 @@ +{-# language PatternSynonyms #-} + +module PatSynUnboundVar where + +pattern P :: Int -> (Int, Int) +pattern P a = (a, b) diff --git a/testsuite/tests/typecheck/should_fail/PatSynUnboundVar.stderr b/testsuite/tests/typecheck/should_fail/PatSynUnboundVar.stderr new file mode 100644 index 0000000000..f65114aa99 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/PatSynUnboundVar.stderr @@ -0,0 +1,4 @@ +PatSynUnboundVar.hs:6:15: [GHC-28572] + Invalid right-hand side of bidirectional pattern synonym ‘P’: + ‘b’ is not bound by the LHS of the pattern synonym + RHS pattern: (a, b) diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 94f0cdfa77..209f292737 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -672,3 +672,6 @@ test('T22924a', normal, compile_fail, ['']) test('T22924b', normal, compile_fail, ['']) test('T22940', normal, compile_fail, ['']) test('T19627', normal, compile_fail, ['']) +test('PatSynExistential', normal, compile_fail, ['']) +test('PatSynArity', normal, compile_fail, ['']) +test('PatSynUnboundVar', normal, compile_fail, ['']) |