mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Correctly instantiate recursion variables under nested aliases
Like we instantiate nested lambda set variables and nested OIOP variables for aliases, we need to do the same for recursion variables.
This commit is contained in:
parent
f2e12724d3
commit
f33651bf6a
4 changed files with 251 additions and 344 deletions
|
@ -2925,12 +2925,14 @@ fn correct_mutual_recursive_type_alias<'a>(
|
|||
};
|
||||
|
||||
let mut new_lambda_sets = ImSet::default();
|
||||
let mut new_recursion_variables = ImSet::default();
|
||||
let mut new_infer_ext_vars = ImSet::default();
|
||||
alias_type.instantiate_aliases(
|
||||
alias_region,
|
||||
&can_instantiate_symbol,
|
||||
var_store,
|
||||
&mut new_lambda_sets,
|
||||
&mut new_recursion_variables,
|
||||
&mut new_infer_ext_vars,
|
||||
);
|
||||
|
||||
|
@ -2953,6 +2955,9 @@ fn correct_mutual_recursive_type_alias<'a>(
|
|||
.map(|var| LambdaSet(Type::Variable(*var))),
|
||||
);
|
||||
|
||||
// add any new recursion variables
|
||||
alias.recursion_variables.extend(new_recursion_variables);
|
||||
|
||||
// add any new infer-in-output extension variables that the instantiation created to the current alias
|
||||
alias
|
||||
.infer_ext_in_output_variables
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue