fix bug: incorrect var definition before switch

This commit is contained in:
Folkert 2021-01-18 23:52:58 +01:00
parent 0ac5a16e86
commit 83fd1de89b
2 changed files with 37 additions and 1 deletions

View file

@ -1533,7 +1533,7 @@ fn decide_to_branching<'a>(
ret_layout,
};
for (symbol, layout, expr) in cond_stores_vec.into_iter() {
for (symbol, layout, expr) in cond_stores_vec.into_iter().rev() {
switch = Stmt::Let(symbol, expr, layout, env.arena.alloc(switch));
}