mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Make using records in defs work
This commit is contained in:
parent
349857a468
commit
010e390fd6
4 changed files with 71 additions and 17 deletions
|
@ -234,7 +234,7 @@ fn layout_from_flat_type<'a>(
|
|||
}
|
||||
};
|
||||
|
||||
let mut field_layouts;
|
||||
let mut field_layouts: Vec<'a, (Lowercase, Layout<'a>)>;
|
||||
|
||||
match ext_layout {
|
||||
Layout::Struct(more_fields) => {
|
||||
|
@ -266,6 +266,9 @@ fn layout_from_flat_type<'a>(
|
|||
field_layouts.push((label.clone(), field_layout));
|
||||
}
|
||||
|
||||
// Sort fields by label
|
||||
field_layouts.sort_by(|(a, _), (b, _)| a.cmp(b));
|
||||
|
||||
Ok(Layout::Struct(field_layouts.into_bump_slice()))
|
||||
}
|
||||
TagUnion(tags, ext_var) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue