RnExpr: Actually fail if patterns found in expression
authorBen Gamari <bgamari.foss@gmail.com>
Tue, 11 Oct 2016 13:26:46 +0000 (09:26 -0400)
committerBen Gamari <ben@smart-cactus.org>
Wed, 12 Oct 2016 15:55:28 +0000 (11:55 -0400)
commit47ae01bfb7ca426188d85c6ecb33ebbacc837aa6
treecb391de5596b86d3dea6fc210a8f20406ec41fdb
parentf168a616f4aae82cc7007310c320032232d09e79
RnExpr: Actually fail if patterns found in expression

This fixes #12584, where wildcard patterns were snuck into an
expression, which then crashed the typechecker in TcExpr since EWildPats
aren't supposed to appear in the AST after renaming.

The problem was that `rnTopSpliceDecl` failed to check for errors from
`rnSplice` (as done by other callers to `rnSplice`).

Thanks to Shayan for reporting this!

Reviewers: simonpj, austin

Reviewed By: simonpj

Subscribers: simonpj, thomie

Differential Revision: https://phabricator.haskell.org/D2539

GHC Trac Issues: #12584

(cherry picked from commit bce99086e9f54909f51ff5a74cb8c666083bb021)
compiler/rename/RnSplice.hs
testsuite/tests/rename/should_fail/all.T
testsuite/tests/rename/should_fail/rnfail016.hs
testsuite/tests/rename/should_fail/rnfail016.stderr
testsuite/tests/rename/should_fail/rnfail016a.hs [new file with mode: 0644]
testsuite/tests/rename/should_fail/rnfail016a.stderr [new file with mode: 0644]