mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
make sure structure variable is copied/references the copy
This commit is contained in:
parent
5fbcfe18d3
commit
e176385169
1 changed files with 36 additions and 2 deletions
|
@ -1411,7 +1411,24 @@ fn instantiate_rigids_help(
|
|||
copy
|
||||
}
|
||||
|
||||
FlexVar(_) | RecursionVar { .. } | Error => copy,
|
||||
FlexVar(_) | Error => copy,
|
||||
|
||||
RecursionVar {
|
||||
opt_name,
|
||||
structure,
|
||||
} => {
|
||||
let new_structure = instantiate_rigids_help(subs, max_rank, pools, structure);
|
||||
|
||||
subs.set(
|
||||
copy,
|
||||
make_descriptor(RecursionVar {
|
||||
opt_name,
|
||||
structure: new_structure,
|
||||
}),
|
||||
);
|
||||
|
||||
copy
|
||||
}
|
||||
|
||||
RigidVar(name) => {
|
||||
subs.set(copy, make_descriptor(FlexVar(Some(name))));
|
||||
|
@ -1586,7 +1603,24 @@ fn deep_copy_var_help(
|
|||
copy
|
||||
}
|
||||
|
||||
FlexVar(_) | RecursionVar { .. } | Error => copy,
|
||||
FlexVar(_) | Error => copy,
|
||||
|
||||
RecursionVar {
|
||||
opt_name,
|
||||
structure,
|
||||
} => {
|
||||
let new_structure = deep_copy_var_help(subs, max_rank, pools, structure);
|
||||
|
||||
subs.set(
|
||||
copy,
|
||||
make_descriptor(RecursionVar {
|
||||
opt_name,
|
||||
structure: new_structure,
|
||||
}),
|
||||
);
|
||||
|
||||
copy
|
||||
}
|
||||
|
||||
RigidVar(name) => {
|
||||
subs.set(copy, make_descriptor(FlexVar(Some(name))));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue