Fix error recovery for pattern synonyms ghc-8.6.1-alpha1
authorSimon Peyton Jones <simonpj@microsoft.com>
Mon, 25 Jun 2018 10:42:46 +0000 (11:42 +0100)
committerBen Gamari <ben@smart-cactus.org>
Wed, 27 Jun 2018 21:07:56 +0000 (17:07 -0400)
commit149d7912eb84a24861b021c13d2ee61b44de5856
treebb00f98bc4d99e70ee5ea37d5594298379a0c247
parent4cfeca02a0a9283e8c9f9ccd9373bc1f2fd8db0a
Fix error recovery for pattern synonyms

As Trac #15289 showed, we were carrying on after a type error
in a pattern synonym, and then crashing.  This patch improves
error handling for pattern synonyms.

I also moved a bit of code from TcBinds into TcPatSyn, which
helpfully narrows the API.

(cherry picked from commit 2896082ec79f02b6388e038a8dae6cb22fe72dfc)
compiler/typecheck/TcBinds.hs
compiler/typecheck/TcPatSyn.hs
compiler/typecheck/TcPatSyn.hs-boot
testsuite/tests/patsyn/should_fail/T15289.stderr
testsuite/tests/patsyn/should_fail/all.T