diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-01-04 17:47:13 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2017-01-05 08:51:46 +0000 |
commit | baf9ebe55a51827c0511b3a670e60b9bb3617ab5 (patch) | |
tree | a43f640a064859e302a09b5ecb87d3f59ba47f12 /compiler/stgSyn | |
parent | c909e6ec333667878b17f127f75204a14256340f (diff) | |
download | haskell-baf9ebe55a51827c0511b3a670e60b9bb3617ab5.tar.gz |
Ensure nested binders have Internal Names
This is a long-standing bug. A nested (non-top-level) binder
in Core should not have an External Name, like M.x. But
- Lint was not checking this invariant
- The desugarer could generate programs that failed the
invariant. An example is in
tests/deSugar/should_compile/T13043, which had
let !_ = M.scState in ...
This desugared to
let ds = case M.scSate of M.scState { DEFAULT -> () }
in case ds of () -> ...
We were wrongly re-using that scrutinee as a case binder.
And Trac #13043 showed that could ultimately lead to two
top-level bindings with the same closure name. Alas!
- The desugarer had one other place (in DsUtils.mkCoreAppDs)
that could generate bogus code
This patch fixes all three bugs, and adds a regression test.
Diffstat (limited to 'compiler/stgSyn')
0 files changed, 0 insertions, 0 deletions