mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Merge pull request #4304 from roc-lang/i4259
Make sure type variables bound to abilities are instantiated in aliases
This commit is contained in:
commit
c1c339dbdf
8 changed files with 440 additions and 66 deletions
|
@ -553,7 +553,7 @@ fn can_annotation_help(
|
|||
references,
|
||||
);
|
||||
|
||||
args.push(arg_ann);
|
||||
args.push(Loc::at(arg.region, arg_ann));
|
||||
}
|
||||
|
||||
match scope.lookup_alias(symbol) {
|
||||
|
@ -573,8 +573,14 @@ fn can_annotation_help(
|
|||
|
||||
let mut type_var_to_arg = Vec::new();
|
||||
|
||||
for (_, arg_ann) in alias.type_variables.iter().zip(args) {
|
||||
type_var_to_arg.push(arg_ann);
|
||||
for (alias_arg, arg_ann) in alias.type_variables.iter().zip(args) {
|
||||
type_var_to_arg.push(Loc::at(
|
||||
arg_ann.region,
|
||||
OptAbleType {
|
||||
typ: arg_ann.value,
|
||||
opt_ability: alias_arg.value.opt_bound_ability,
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
let mut lambda_set_variables =
|
||||
|
|
|
@ -829,7 +829,15 @@ fn canonicalize_opaque<'a>(
|
|||
type_arguments: alias
|
||||
.type_variables
|
||||
.iter()
|
||||
.map(|_| Type::Variable(var_store.fresh()))
|
||||
.map(|alias_var| {
|
||||
Loc::at(
|
||||
alias_var.region,
|
||||
OptAbleType {
|
||||
typ: Type::Variable(var_store.fresh()),
|
||||
opt_ability: alias_var.value.opt_bound_ability,
|
||||
},
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
lambda_set_variables: alias
|
||||
.lambda_set_variables
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue