mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 00:01:16 +00:00
switch to new unification table
This commit is contained in:
parent
4550f3fa88
commit
2b94eeed60
3 changed files with 233 additions and 224 deletions
|
@ -413,7 +413,7 @@ fn deep_copy_type_vars<'a>(
|
|||
// Always deal with the root, so that unified variables are treated the same.
|
||||
let var = subs.get_root_key_without_compacting(var);
|
||||
|
||||
let desc = subs.get_ref_mut(var);
|
||||
let desc = subs.get(var);
|
||||
|
||||
// Unlike `deep_copy_var` in solve, here we are cloning *all* flex and rigid vars.
|
||||
// So we only want to short-circuit if we've already done the cloning work for a particular
|
||||
|
@ -432,7 +432,7 @@ fn deep_copy_type_vars<'a>(
|
|||
};
|
||||
|
||||
let copy = subs.fresh(copy_descriptor);
|
||||
subs.get_ref_mut(var).copy = copy.into();
|
||||
subs.set_copy(var, copy.into());
|
||||
|
||||
visited.push(var);
|
||||
|
||||
|
@ -456,7 +456,7 @@ fn deep_copy_type_vars<'a>(
|
|||
let new_arguments = VariableSubsSlice::reserve_into_subs(subs, $slice.len());
|
||||
for (target_index, var_index) in (new_arguments.indices()).zip($slice) {
|
||||
let var = subs[var_index];
|
||||
let copy_var = subs.get_ref(var).copy.into_variable().unwrap_or(var);
|
||||
let copy_var = subs.get_copy(var).into_variable().unwrap_or(var);
|
||||
subs.variables[target_index] = copy_var;
|
||||
}
|
||||
new_arguments
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue