mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Add RigidOptional record field variant
This commit is contained in:
parent
b911e01136
commit
81bb889e93
13 changed files with 102 additions and 12 deletions
|
@ -2149,7 +2149,7 @@ fn layout_from_flat_type<'a>(
|
|||
RecordField::Required(field_var) | RecordField::Demanded(field_var) => {
|
||||
sortables.push((label, Layout::from_var(env, field_var)?));
|
||||
}
|
||||
RecordField::Optional(_) => {
|
||||
RecordField::Optional(_) | RecordField::RigidOptional(_) => {
|
||||
// drop optional fields
|
||||
}
|
||||
}
|
||||
|
@ -2250,7 +2250,7 @@ fn sort_record_fields_help<'a>(
|
|||
let layout = Layout::from_var(env, v)?;
|
||||
sorted_fields.push((label, v, Ok(layout)));
|
||||
}
|
||||
RecordField::Optional(v) => {
|
||||
RecordField::Optional(v) | RecordField::RigidOptional(v) => {
|
||||
let layout = Layout::from_var(env, v)?;
|
||||
sorted_fields.push((label, v, Err(layout)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue