mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Store declared implementations, both custom and derived, in abilities store
This commit is contained in:
parent
6035e45f25
commit
e2454f497f
10 changed files with 249 additions and 171 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue