Skip to content

SetLevels: Don't set context level when floating cases

Ben Gamari requested to merge wip/T16978 into master

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 (closed), where the disrepancy caused us to unnecessarily abstract over some free variables of the case body, resulting in shadowing and consequently Core Lint failures.

I tried to construct a more minimal testsuite demonstrating the issue from #16978 (closed) more clearly but the simplifier resisted fiercely.

Merge request reports