Cleanup abilities_in_scope and rename to pending_abilities_in_scope

`abilities_in_scope` is a buffer we use to keep track of locally-defined
abilities before we've fully resolved them. We do this because we
canonicalize ability members signatures before we've registered an
ability to the abilities store, and canonicalization of signatures must
report `has` bounds that don't reference abilities.

So, this buffer is more appropriately named `pending_abilities_in_scope`.
There is also no reason to export it, because it is only relevant
during canonicalization of type defs in a module.
This commit is contained in:
Ayaz Hafiz 2022-05-20 09:57:31 -04:00
parent 3bd5c83bba
commit 4cf87510c8
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -231,7 +231,7 @@ fn canonicalize_alias<'a>(
output: &mut Output, output: &mut Output,
var_store: &mut VarStore, var_store: &mut VarStore,
scope: &mut Scope, scope: &mut Scope,
abilities_in_scope: &[Symbol], pending_abilities_in_scope: &[Symbol],
name: Loc<Symbol>, name: Loc<Symbol>,
ann: &'a Loc<ast::TypeAnnotation<'a>>, ann: &'a Loc<ast::TypeAnnotation<'a>>,
@ -245,7 +245,7 @@ fn canonicalize_alias<'a>(
&ann.value, &ann.value,
ann.region, ann.region,
var_store, var_store,
abilities_in_scope, pending_abilities_in_scope,
); );
// Record all the annotation's references in output.references.lookups // Record all the annotation's references in output.references.lookups
@ -343,7 +343,7 @@ fn canonicalize_opaque<'a>(
output: &mut Output, output: &mut Output,
var_store: &mut VarStore, var_store: &mut VarStore,
scope: &mut Scope, scope: &mut Scope,
abilities_in_scope: &[Symbol], pending_abilities_in_scope: &[Symbol],
name: Loc<Symbol>, name: Loc<Symbol>,
ann: &'a Loc<ast::TypeAnnotation<'a>>, ann: &'a Loc<ast::TypeAnnotation<'a>>,
@ -355,7 +355,7 @@ fn canonicalize_opaque<'a>(
output, output,
var_store, var_store,
scope, scope,
abilities_in_scope, pending_abilities_in_scope,
name, name,
ann, ann,
vars, vars,
@ -375,7 +375,7 @@ fn canonicalize_opaque<'a>(
&derived.value, &derived.value,
region, region,
var_store, var_store,
abilities_in_scope, pending_abilities_in_scope,
); );
match can_derived.typ { match can_derived.typ {
Type::Apply(ability, args, _) Type::Apply(ability, args, _)