remove union_size from Tag expr

This commit is contained in:
Folkert 2021-07-02 10:48:03 +02:00
parent 28520b2cf4
commit 6e3a2cd94d
5 changed files with 17 additions and 17 deletions

View file

@ -973,10 +973,9 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
Tag {
arguments,
tag_layout: union_layout,
union_size,
tag_id,
..
} => build_tag(env, scope, union_layout, *union_size, *tag_id, arguments),
} => build_tag(env, scope, union_layout, *tag_id, arguments),
Reset(_) => todo!(),
Reuse { .. } => todo!(),
@ -1174,12 +1173,13 @@ pub fn build_tag<'a, 'ctx, 'env>(
env: &Env<'a, 'ctx, 'env>,
scope: &Scope<'a, 'ctx>,
union_layout: &UnionLayout<'a>,
union_size: u8,
tag_id: u8,
arguments: &[Symbol],
) -> BasicValueEnum<'ctx> {
let tag_id_layout = union_layout.tag_id_layout();
let union_size = union_layout.number_of_tags();
match union_layout {
UnionLayout::NonRecursive(tags) => {
debug_assert!(union_size > 1);