mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
fix bug with optional record fields
This commit is contained in:
parent
46755973d6
commit
127dd06586
10 changed files with 202 additions and 162 deletions
|
@ -705,17 +705,11 @@ fn unify_flat_type(
|
|||
(EmptyRecord, EmptyRecord) => merge(subs, ctx, Structure(left.clone())),
|
||||
|
||||
(Record(fields, ext), EmptyRecord) if has_only_optional_fields(&mut fields.values()) => {
|
||||
let mut outcome = unify_pool(subs, pool, *ext, ctx.second);
|
||||
outcome.extend(merge(subs, ctx, Structure(FlatType::EmptyRecord)));
|
||||
|
||||
outcome
|
||||
unify_pool(subs, pool, *ext, ctx.second)
|
||||
}
|
||||
|
||||
(EmptyRecord, Record(fields, ext)) if has_only_optional_fields(&mut fields.values()) => {
|
||||
let mut outcome = unify_pool(subs, pool, ctx.first, *ext);
|
||||
outcome.extend(merge(subs, ctx, Structure(FlatType::EmptyRecord)));
|
||||
|
||||
outcome
|
||||
unify_pool(subs, pool, ctx.first, *ext)
|
||||
}
|
||||
|
||||
(Record(fields1, ext1), Record(fields2, ext2)) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue