switch to new unification table

This commit is contained in:
Folkert 2022-05-20 21:54:22 +02:00
parent 4550f3fa88
commit 2b94eeed60
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 233 additions and 224 deletions

View file

@ -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