Commit a2a0e6f3 authored by Ben Gamari's avatar Ben Gamari 🐢

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 not what FloatOut did: it rather left
parent 6bd8b6d1
Pipeline #9564 passed with stages
in 332 minutes and 54 seconds
......@@ -504,7 +504,7 @@ Consider this:
Here we can float the (case y ...) out, because y is sure
to be evaluated, to give
f x vs = case x of { MkT y ->
caes y of I# w ->
case y of I# w ->
let f vs = ...(e)...f..
in f vs
......@@ -1674,9 +1674,7 @@ cloneCaseBndrs env@(LE { le_subst = subst, le_lvl_env = lvl_env, le_env = id_env
new_lvl vs
= do { us <- getUniqueSupplyM
; let (subst', vs') = cloneBndrs subst us vs
env' = env { le_ctxt_lvl = new_lvl
, le_join_ceil = new_lvl
, le_lvl_env = addLvls new_lvl lvl_env vs'
env' = env { le_lvl_env = addLvls new_lvl lvl_env vs'
, le_subst = subst'
, le_env = foldl' add_id id_env (vs `zip` vs') }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment