Import both specializations and declared ability mappings

This commit is contained in:
Ayaz Hafiz 2022-07-25 10:06:49 -04:00
parent cd0b8577ab
commit 0525c6d616
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
5 changed files with 159 additions and 86 deletions

View file

@ -1,4 +1,4 @@
use crate::abilities::{MemberSpecializationInfo, PendingAbilitiesStore, Resolved};
use crate::abilities::{ImplKey, PendingAbilitiesStore, ResolvedImpl};
use crate::annotation::canonicalize_annotation;
use crate::def::{canonicalize_defs, Def};
use crate::effect_module::HostedGeneratedFunctions;
@ -103,14 +103,20 @@ impl ExposedForModule {
}
}
pub type ResolvedSpecializations = VecMap<Symbol, MemberSpecializationInfo<Resolved>>;
/// During type solving and monomorphization, a module must know how its imported ability
/// implementations are resolved - are they derived, or have a concrete implementation?
///
/// Unfortunately we cannot keep this information opaque, as it's important for properly
/// restoring specialization lambda sets. As such, we need to export implementation information,
/// which is the job of this structure.
pub type ResolvedImplementations = VecMap<ImplKey, ResolvedImpl>;
/// The types of all exposed values/functions of a module. This includes ability member
/// specializations.
#[derive(Clone, Debug)]
pub struct ExposedModuleTypes {
pub exposed_types_storage_subs: ExposedTypesStorageSubs,
pub resolved_specializations: ResolvedSpecializations,
pub resolved_implementations: ResolvedImplementations,
}
#[derive(Debug)]