mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
fix recursive tag unions too
This commit is contained in:
parent
0f1baef160
commit
d821a17413
1 changed files with 9 additions and 0 deletions
|
@ -866,6 +866,15 @@ fn layout_from_flat_type<'a>(
|
|||
tag_layout.push(Layout::from_var(env, var)?);
|
||||
}
|
||||
|
||||
tag_layout.sort_by(|layout1, layout2| {
|
||||
let ptr_bytes = 8;
|
||||
|
||||
let size1 = layout1.alignment_bytes(ptr_bytes);
|
||||
let size2 = layout2.alignment_bytes(ptr_bytes);
|
||||
|
||||
size2.cmp(&size1)
|
||||
});
|
||||
|
||||
tag_layouts.push(tag_layout.into_bump_slice());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue