mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
add storage subs to ExposedModuleTypes
This commit is contained in:
parent
28abf5b1b8
commit
78f5526db3
2 changed files with 18 additions and 3 deletions
|
@ -13,7 +13,12 @@ pub type SubsByModule = MutMap<ModuleId, ExposedModuleTypes>;
|
|||
#[derive(Clone, Debug)]
|
||||
pub enum ExposedModuleTypes {
|
||||
Invalid,
|
||||
Valid(MutMap<Symbol, SolvedType>, MutMap<Symbol, Alias>),
|
||||
Valid {
|
||||
solved_types: MutMap<Symbol, SolvedType>,
|
||||
aliases: MutMap<Symbol, Alias>,
|
||||
stored_vars_by_symbol: Vec<(Symbol, Variable)>,
|
||||
storage_subs: roc_types::subs::StorageSubs,
|
||||
},
|
||||
}
|
||||
|
||||
pub fn constrain_module(
|
||||
|
@ -174,7 +179,12 @@ pub fn pre_constrain_imports(
|
|||
};
|
||||
|
||||
match exposed_types.get(&module_id) {
|
||||
Some(ExposedModuleTypes::Valid(solved_types, new_aliases)) => {
|
||||
Some(ExposedModuleTypes::Valid {
|
||||
solved_types,
|
||||
aliases: new_aliases,
|
||||
storage_subs,
|
||||
stored_vars_by_symbol,
|
||||
}) => {
|
||||
// If the exposed value was invalid (e.g. it didn't have
|
||||
// a corresponding definition), it won't have an entry
|
||||
// in solved_types
|
||||
|
|
|
@ -1832,7 +1832,12 @@ fn update<'a>(
|
|||
} else {
|
||||
state.exposed_types.insert(
|
||||
module_id,
|
||||
ExposedModuleTypes::Valid(solved_module.solved_types, solved_module.aliases),
|
||||
ExposedModuleTypes::Valid {
|
||||
solved_types: solved_module.solved_types,
|
||||
aliases: solved_module.aliases,
|
||||
stored_vars_by_symbol: solved_module.stored_vars_by_symbol,
|
||||
storage_subs: solved_module.storage_subs,
|
||||
},
|
||||
);
|
||||
|
||||
if state.goal_phase > Phase::SolveTypes {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue