Store declared implementations, both custom and derived, in abilities store

This commit is contained in:
Ayaz Hafiz 2022-07-19 18:23:42 -04:00
parent 6035e45f25
commit e2454f497f
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
10 changed files with 249 additions and 171 deletions

View file

@ -2,7 +2,7 @@
use roc_module::{ident::Lowercase, symbol::Symbol};
use roc_region::all::{Loc, Region};
use roc_types::subs::Variable;
use roc_types::{subs::Variable, types::MemberImpl};
use crate::{
abilities::AbilitiesStore,
@ -587,8 +587,8 @@ pub fn find_ability_member_and_owning_type_at(
abilities_store: &AbilitiesStore,
) -> Option<Symbol> {
abilities_store
.iter_specializations()
.find(|(_, ms)| ms.symbol == symbol)
.iter_declared_implementations()
.find(|(_, member_impl)| matches!(member_impl, MemberImpl::Impl(sym) if *sym == symbol))
.map(|(spec, _)| spec.1)
}
}