diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2017-12-20 19:25:30 -0500 |
---|---|---|
committer | Ryan Scott <ryan.gl.scott@gmail.com> | 2017-12-20 19:25:31 -0500 |
commit | 9caf40e9d7233a2a6e78a0c4f2d2f13acbf804dd (patch) | |
tree | c78c3f7dbdd5b090fbc96c652957d87dee8c11e6 /testsuite/tests/parser | |
parent | 1bd91a7ac60eba3b0c019e2228f4b2b07f8cd5ad (diff) | |
download | haskell-9caf40e9d7233a2a6e78a0c4f2d2f13acbf804dd.tar.gz |
Fix #14588 by checking for more bang patterns
Summary:
Commit 372995364c52eef15066132d7d1ea8b6760034e6
inadvertently removed a check in the parser which rejected
let-bindings with bang patterns, leading to #14588. This fixes it by
creating a `hintBangPat` function to perform this check, and
sprinkling it in the right places.
Test Plan: make test TEST=T14588
Reviewers: bgamari, alanz, simonpj
Reviewed By: bgamari, simonpj
Subscribers: rwbarton, thomie, mpickering, carter
GHC Trac Issues: #14588
Differential Revision: https://phabricator.haskell.org/D4270
Diffstat (limited to 'testsuite/tests/parser')
-rw-r--r-- | testsuite/tests/parser/should_fail/T14588.hs | 3 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/T14588.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/all.T | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_fail/T14588.hs b/testsuite/tests/parser/should_fail/T14588.hs new file mode 100644 index 0000000000..8a0bcecd7b --- /dev/null +++ b/testsuite/tests/parser/should_fail/T14588.hs @@ -0,0 +1,3 @@ +module T14588 where + +main = print (let !x = 1 + 2 in x) diff --git a/testsuite/tests/parser/should_fail/T14588.stderr b/testsuite/tests/parser/should_fail/T14588.stderr new file mode 100644 index 0000000000..cb64103814 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T14588.stderr @@ -0,0 +1,4 @@ + +T14588.hs:3:19: error: + Illegal bang-pattern (use BangPatterns): + ! x diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index abe3da9775..483e5fe511 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -102,3 +102,4 @@ test('T8501a', normal, compile_fail, ['']) test('T8501b', normal, compile_fail, ['']) test('T8501c', normal, compile_fail, ['']) test('T12610', normal, compile_fail, ['']) +test('T14588', normal, compile_fail, ['']) |