diff options
author | Alfredo Di Napoli <alfredo@well-typed.com> | 2021-07-06 14:57:55 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-07-09 08:46:44 -0400 |
commit | 6b4f3a99f1e04943ca5a43490284c5774a346bbb (patch) | |
tree | b02b9a1184ab246af7c2258dfb6a89ebd87f234e /testsuite | |
parent | e17850c4b9b988809dafbd6a35c7b3c3bf050dd5 (diff) | |
download | haskell-6b4f3a99f1e04943ca5a43490284c5774a346bbb.tar.gz |
Add TcRnIllegalViewPattern to TcRnMessage
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/parser/should_fail/ViewPatternsFail.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/ViewPatternsFail.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/all.T | 1 |
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, ['']) |