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:52:39 +0000 (11:52 -0400)
commitbce99086e9f54909f51ff5a74cb8c666083bb021
tree3456caa772779cccd04056a90d9b78367ad5515b
parentd2959dfbbbc33a0a44c498d1e6b424615b7d756d
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
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]