mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
wip
This commit is contained in:
parent
ceb938c9af
commit
46755973d6
8 changed files with 59 additions and 13 deletions
|
@ -705,11 +705,17 @@ fn unify_flat_type(
|
|||
(EmptyRecord, EmptyRecord) => merge(subs, ctx, Structure(left.clone())),
|
||||
|
||||
(Record(fields, ext), EmptyRecord) if has_only_optional_fields(&mut fields.values()) => {
|
||||
unify_pool(subs, pool, *ext, ctx.second)
|
||||
let mut outcome = unify_pool(subs, pool, *ext, ctx.second);
|
||||
outcome.extend(merge(subs, ctx, Structure(FlatType::EmptyRecord)));
|
||||
|
||||
outcome
|
||||
}
|
||||
|
||||
(EmptyRecord, Record(fields, ext)) if has_only_optional_fields(&mut fields.values()) => {
|
||||
unify_pool(subs, pool, ctx.first, *ext)
|
||||
let mut outcome = unify_pool(subs, pool, ctx.first, *ext);
|
||||
outcome.extend(merge(subs, ctx, Structure(FlatType::EmptyRecord)));
|
||||
|
||||
outcome
|
||||
}
|
||||
|
||||
(Record(fields1, ext1), Record(fields2, ext2)) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue