summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/parser/should_fail/ViewPatternsFail.hs7
-rw-r--r--testsuite/tests/parser/should_fail/ViewPatternsFail.stderr4
-rw-r--r--testsuite/tests/parser/should_fail/all.T1
3 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_fail/ViewPatternsFail.hs b/testsuite/tests/parser/should_fail/ViewPatternsFail.hs
new file mode 100644
index 0000000000..35517575b5
--- /dev/null
+++ b/testsuite/tests/parser/should_fail/ViewPatternsFail.hs
@@ -0,0 +1,7 @@
+
+module ViewPatternsFail where
+
+data Foo = Foo { a :: Int }
+
+foo :: Foo -> Int
+foo (a -> l) = l
diff --git a/testsuite/tests/parser/should_fail/ViewPatternsFail.stderr b/testsuite/tests/parser/should_fail/ViewPatternsFail.stderr
new file mode 100644
index 0000000000..97d82b4c16
--- /dev/null
+++ b/testsuite/tests/parser/should_fail/ViewPatternsFail.stderr
@@ -0,0 +1,4 @@
+
+ViewPatternsFail.hs:7:6: error:
+ Illegal view pattern: a -> l
+ Suggested fix: Perhaps you intended to use ViewPatterns
diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T
index 7787826a4b..c288f47c2f 100644
--- a/testsuite/tests/parser/should_fail/all.T
+++ b/testsuite/tests/parser/should_fail/all.T
@@ -195,3 +195,4 @@ test('T19923a', normal, compile_fail, [''])
test('T19923b', normal, compile_fail, [''])
test('T19923c', normal, compile_fail, [''])
test('RecordWildCardsFail', normal, compile_fail, [''])
+test('ViewPatternsFail', normal, compile_fail, [''])