mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
optional fields improvements
This commit is contained in:
parent
48aebc5c59
commit
b45b39af5e
14 changed files with 329 additions and 47 deletions
|
@ -620,6 +620,7 @@ fn type_to_variable(
|
|||
let field_var = match field_type {
|
||||
Required(typ) => Required(type_to_variable(subs, rank, pools, cached, typ)),
|
||||
Optional(typ) => Optional(type_to_variable(subs, rank, pools, cached, typ)),
|
||||
Demanded(typ) => Demanded(type_to_variable(subs, rank, pools, cached, typ)),
|
||||
};
|
||||
|
||||
field_vars.insert(field.clone(), field_var);
|
||||
|
@ -1257,6 +1258,9 @@ fn deep_copy_var_help(
|
|||
use RecordField::*;
|
||||
|
||||
let new_field = match field {
|
||||
Demanded(var) => {
|
||||
Demanded(deep_copy_var_help(subs, max_rank, pools, var))
|
||||
}
|
||||
Required(var) => {
|
||||
Required(deep_copy_var_help(subs, max_rank, pools, var))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue