mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Merge pull request #3589 from rtfeldman/can-abilities3
Canonicalize syntactic abilities: Part 3 - solving
This commit is contained in:
commit
6b6f240acb
21 changed files with 594 additions and 274 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,
|
||||
|
@ -591,8 +591,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