Reject top-level banged bindings
authorSimon Peyton Jones <simonpj@microsoft.com>
Mon, 31 Jul 2017 12:22:38 +0000 (13:22 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Mon, 31 Jul 2017 12:36:49 +0000 (13:36 +0100)
commitaf89d6872da2e00be738e1ac541346cd84e6d141
tree5f7636610dccb71880580d4e3b13820a503fb8de
parent3ab342eb1b82ba9218a9d7786c523b1128b2bdf1
Reject top-level banged bindings

Bizarrely, we were not rejecting
  !x = e

Fix:

* In the test in DsBinds.dsTopLHsBinds, use isBangedHsBind, not
  isBangedPatBind.  (Indeed the latter dies altogther.)

* Implement isBangedHsBind in HsUtils;
  be sure to handle AbsBinds

All this was shown up by Trac #13594
compiler/deSugar/DsBinds.hs
compiler/hsSyn/HsPat.hs
compiler/hsSyn/HsUtils.hs
testsuite/tests/typecheck/should_compile/T13594.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T