mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
index to slice of indicies
This commit is contained in:
parent
1c1231bc11
commit
347431d1df
7 changed files with 41 additions and 23 deletions
|
@ -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?!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue