Make sure ability defs that are possibly recursive are marked as such

This commit is contained in:
Ayaz Hafiz 2022-07-25 10:52:55 -04:00
parent 0525c6d616
commit 75ce40c67d
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
4 changed files with 18 additions and 2 deletions

View file

@ -1530,6 +1530,13 @@ fn canonicalize_var_lookup(
output.references.insert_value_lookup(symbol);
if scope.abilities_store.is_ability_member_name(symbol) {
// Is there a shadow implementation with the same name? If so, we might be in
// the def for that shadow. In that case add a value lookup of the shadow impl,
// so that it's marked as possibly-recursive.
if let Some(shadow) = scope.get_member_shadow(symbol) {
output.references.insert_value_lookup(shadow.value);
}
AbilityMember(
symbol,
Some(scope.abilities_store.fresh_specialization_id()),