SetLevels: Don't set context level when floating cases
When floating a single-alternative case we previously would set the context level to the level where we were floating the case. However, this is wrong as we are only moving the case and its binders. This resulted in #16978, where the disrepancy caused us to unnecessarily abstract over some free variables of the case body, resulting in shadowing and consequently Core Lint failures. (cherry picked from commit a2a0e6f3)
Showing
- compiler/simplCore/SetLevels.hs 33 additions, 4 deletionscompiler/simplCore/SetLevels.hs
- testsuite/tests/simplCore/should_compile/T16978a.hs 0 additions, 0 deletionstestsuite/tests/simplCore/should_compile/T16978a.hs
- testsuite/tests/simplCore/should_compile/T16978b.hs 18 additions, 0 deletionstestsuite/tests/simplCore/should_compile/T16978b.hs
- testsuite/tests/simplCore/should_compile/all.T 2 additions, 1 deletiontestsuite/tests/simplCore/should_compile/all.T
Please register or sign in to comment