fix usage of layout in Switch; always use outer layout

This commit is contained in:
Folkert 2021-06-16 22:05:30 +02:00
parent 765c81ad09
commit ee2a1d74ed

View file

@ -263,7 +263,7 @@ fn stmt_spec(
cond_layout: _,
branches,
default_branch,
ret_layout,
ret_layout: _lies,
} => {
let mut cases = Vec::with_capacity(branches.len() + 1);
@ -274,7 +274,7 @@ fn stmt_spec(
for branch in it {
let block = builder.add_block();
let value_id = stmt_spec(builder, env, block, ret_layout, branch)?;
let value_id = stmt_spec(builder, env, block, layout, branch)?;
cases.push(BlockExpr(block, value_id));
}