Add JSON builtin, pass along solved specializations per module

This commit is contained in:
Ayaz Hafiz 2022-05-11 14:31:06 -04:00
parent 312cdd0b70
commit 0f4be93e44
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
8 changed files with 93 additions and 13 deletions

View file

@ -1,4 +1,4 @@
use roc_collections::{all::MutMap, VecSet};
use roc_collections::{all::MutMap, VecMap, VecSet};
use roc_error_macros::internal_error;
use roc_module::symbol::Symbol;
use roc_region::all::Region;
@ -46,6 +46,8 @@ impl AbilityMemberData {
}
}
pub type SolvedSpecializations = VecMap<(Symbol, Symbol), MemberSpecialization>;
/// A particular specialization of an ability member.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct MemberSpecialization {
@ -88,7 +90,7 @@ pub struct AbilitiesStore {
/// Maps a tuple (member, type) specifying that `type` declares an implementation of an ability
/// member `member`, to the exact symbol that implements the ability.
declared_specializations: MutMap<(Symbol, Symbol), MemberSpecialization>,
declared_specializations: SolvedSpecializations,
next_specialization_id: u32,