mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
remove tag_id in favor of index
This commit is contained in:
parent
347431d1df
commit
90223022af
8 changed files with 32 additions and 33 deletions
|
@ -1438,12 +1438,13 @@ fn expr_spec<'a>(
|
|||
},
|
||||
UnionFieldPtrAtIndex {
|
||||
index,
|
||||
tag_id,
|
||||
structure,
|
||||
union_layout,
|
||||
..
|
||||
} => {
|
||||
debug_assert_ne!(index.len(), 0);
|
||||
let index = index[0];
|
||||
debug_assert!(index.len() >= 2);
|
||||
let tag_id = index[0] as u32;
|
||||
let index = index[1];
|
||||
let tag_value_id = env.symbols[structure];
|
||||
|
||||
let type_name_bytes = recursive_tag_union_name_bytes(union_layout).as_bytes();
|
||||
|
@ -1460,7 +1461,7 @@ fn expr_spec<'a>(
|
|||
builder.add_touch(block, heap_cell)?;
|
||||
|
||||
// next, unwrap the union at the tag id that we've got
|
||||
let variant_id = builder.add_unwrap_union(block, union_data, *tag_id as u32)?;
|
||||
let variant_id = builder.add_unwrap_union(block, union_data, tag_id)?;
|
||||
|
||||
let value = builder.add_get_tuple_field(block, variant_id, index as u32)?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue