mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Correct tag ID matching of nullable wrapped tags
This commit is contained in:
parent
bbcd9c3a52
commit
5abf121efe
2 changed files with 38 additions and 2 deletions
|
@ -1123,7 +1123,10 @@ fn build_tag_eq_help<'a, 'ctx>(
|
|||
|
||||
env.builder.build_return(Some(&answer));
|
||||
}
|
||||
NullableWrapped { other_tags, .. } => {
|
||||
NullableWrapped {
|
||||
other_tags,
|
||||
nullable_id,
|
||||
} => {
|
||||
let ptr_equal = env.builder.build_int_compare(
|
||||
IntPredicate::EQ,
|
||||
env.builder
|
||||
|
@ -1204,7 +1207,9 @@ fn build_tag_eq_help<'a, 'ctx>(
|
|||
let tags = other_tags;
|
||||
let mut cases = Vec::with_capacity_in(tags.len(), env.arena);
|
||||
|
||||
for (tag_id, field_layouts) in tags.iter().enumerate() {
|
||||
for (i, field_layouts) in tags.iter().enumerate() {
|
||||
let tag_id = if i >= (*nullable_id as _) { i + 1 } else { i };
|
||||
|
||||
let block = env.context.append_basic_block(parent, "tag_id_modify");
|
||||
env.builder.position_at_end(block);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue