Fix order of alias arg discovery

This commit is contained in:
Ayaz Hafiz 2022-11-16 14:05:03 -06:00
parent cc677917a7
commit 28768bcfba
No known key found for this signature in database
GPG Key ID: 0E2A37416A25EF58
2 changed files with 6 additions and 5 deletions

View File

@ -2454,12 +2454,13 @@ fn count_generated_name_usages<'a>(
stack.push((ret, false));
}
Alias(_, args, real, _) => {
// First, count the occurrences in the real var
stack.push((real, false));
// Then, count up any phantom args that were missed b/c they're not referenced in
// the real var. Set `only_unseen` so that we don not double-count vars that do
// appear in the real var.
stack.extend(args.iter().map(|t| (t, true)));
// First, count the occurrences in the real var
stack.push((real, false));
}
Infinite | Error => {}
Range(_) => {}

View File

@ -1330,7 +1330,7 @@ mod test_reporting {
This `bar` value is a:
{ bar : Int * }
{ bar : Int a }
But `f` needs its 1st argument to be:
@ -1398,7 +1398,7 @@ mod test_reporting {
This `Blue` tag application has the type:
[Blue (Frac *)]
[Blue (Frac a)]
But `f` needs its 1st argument to be:
@ -2788,7 +2788,7 @@ mod test_reporting {
The argument is a record of type:
{ y : Frac * }
{ y : Frac a }
But `f` needs its 1st argument to be: