index to slice of indicies

This commit is contained in:
HajagosNorbert 2023-11-13 13:56:05 +01:00
parent 1c1231bc11
commit 347431d1df
No known key found for this signature in database
GPG key ID: 807F4444870DB673
7 changed files with 41 additions and 23 deletions

View file

@ -1442,7 +1442,8 @@ fn expr_spec<'a>(
structure,
union_layout,
} => {
let index = (*index) as u32;
debug_assert_ne!(index.len(), 0);
let index = index[0];
let tag_value_id = env.symbols[structure];
let type_name_bytes = recursive_tag_union_name_bytes(union_layout).as_bytes();
@ -1461,7 +1462,7 @@ fn expr_spec<'a>(
// 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 value = builder.add_get_tuple_field(block, variant_id, index)?;
let value = builder.add_get_tuple_field(block, variant_id, index as u32)?;
// construct the box. Here the heap_cell of the tag is re-used, I'm hoping that that
// conveys to morphic that we're borrowing into the existing tag?!