Make sure type variables bound to abilities are instantiated in aliases

Closes #4259
This commit is contained in:
Ayaz Hafiz 2022-10-11 15:04:38 -05:00
parent 89a4522faa
commit 20e4295eea
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
8 changed files with 435 additions and 66 deletions

View file

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