testsuite: Add broken test for #15289
authorBen Gamari <ben@smart-cactus.org>
Mon, 18 Jun 2018 23:10:10 +0000 (19:10 -0400)
committerBen Gamari <ben@smart-cactus.org>
Wed, 20 Jun 2018 00:15:46 +0000 (20:15 -0400)
The stderr output is merely a guess at what we should expect, but currently this
is certainly broken.

testsuite/tests/patsyn/should_fail/T15289.hs [new file with mode: 0644]
testsuite/tests/patsyn/should_fail/T15289.stderr [new file with mode: 0644]
testsuite/tests/patsyn/should_fail/all.T

diff --git a/testsuite/tests/patsyn/should_fail/T15289.hs b/testsuite/tests/patsyn/should_fail/T15289.hs
new file mode 100644 (file)
index 0000000..bc9143a
--- /dev/null
@@ -0,0 +1,5 @@
+{-# LANGUAGE PatternSynonyms #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+module Oops where
+
+pattern What = True :: Maybe
diff --git a/testsuite/tests/patsyn/should_fail/T15289.stderr b/testsuite/tests/patsyn/should_fail/T15289.stderr
new file mode 100644 (file)
index 0000000..b19d7a0
--- /dev/null
@@ -0,0 +1,8 @@
+  T15289.hs:5:16: error:
+      • Couldn't match expected type ‘Maybe’ with actual type ‘Bool’
+      • In the pattern: True
+        In the pattern: True :: Maybe
+        In the declaration for pattern synonym ‘What’
+    |
+  5 | pattern What = True :: Maybe
+    |                ^^^^
index d3a0a9b..269dc8d 100644 (file)
@@ -42,3 +42,4 @@ test('T14380', normal, compile_fail, [''])
 test('T14498', normal, compile_fail, [''])
 test('T14552', normal, compile_fail, [''])
 test('T14507', normal, compile_fail, ['-dsuppress-uniques'])
+test('T15289', expect_broken(15289), compile_fail, [''])