Fix #14588 by checking for more bang patterns
authorRyan Scott <ryan.gl.scott@gmail.com>
Thu, 21 Dec 2017 00:25:30 +0000 (19:25 -0500)
committerRyan Scott <ryan.gl.scott@gmail.com>
Thu, 21 Dec 2017 00:25:31 +0000 (19:25 -0500)
commit9caf40e9d7233a2a6e78a0c4f2d2f13acbf804dd
treec78c3f7dbdd5b090fbc96c652957d87dee8c11e6
parent1bd91a7ac60eba3b0c019e2228f4b2b07f8cd5ad
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
compiler/parser/Parser.y
compiler/parser/RdrHsSyn.hs
testsuite/tests/parser/should_fail/T14588.hs [new file with mode: 0644]
testsuite/tests/parser/should_fail/T14588.stderr [new file with mode: 0644]
testsuite/tests/parser/should_fail/all.T