mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-15 02:27:44 +00:00
don't refcount the empty tag union
This commit is contained in:
parent
fb123b8990
commit
cb4b726c7e
1 changed files with 21 additions and 17 deletions
|
|
@ -1280,24 +1280,28 @@ fn refcount_union_nonrec<'a>(
|
||||||
|
|
||||||
let continuation = rc_return_stmt(root, ident_ids, ctx);
|
let continuation = rc_return_stmt(root, ident_ids, ctx);
|
||||||
|
|
||||||
let switch_stmt = refcount_union_contents(
|
if tag_layouts.is_empty() {
|
||||||
root,
|
continuation
|
||||||
ident_ids,
|
} else {
|
||||||
ctx,
|
let switch_stmt = refcount_union_contents(
|
||||||
layout_interner,
|
root,
|
||||||
union_layout,
|
ident_ids,
|
||||||
tag_layouts,
|
ctx,
|
||||||
None,
|
layout_interner,
|
||||||
structure,
|
union_layout,
|
||||||
tag_id_sym,
|
tag_layouts,
|
||||||
tag_id_layout,
|
None,
|
||||||
continuation,
|
structure,
|
||||||
);
|
tag_id_sym,
|
||||||
|
tag_id_layout,
|
||||||
|
continuation,
|
||||||
|
);
|
||||||
|
|
||||||
tag_id_stmt(root.arena.alloc(
|
tag_id_stmt(root.arena.alloc(
|
||||||
//
|
//
|
||||||
switch_stmt,
|
switch_stmt,
|
||||||
))
|
))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn refcount_union_contents<'a>(
|
fn refcount_union_contents<'a>(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue