mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-15 17:40:16 +00:00
Fix importing of module params vars
This commit is contained in:
parent
89fc1104f0
commit
d23a8dc618
5 changed files with 36 additions and 61 deletions
|
@ -1,5 +1,3 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use crate::solve::RunSolveOutput;
|
||||
use crate::FunctionKind;
|
||||
use crate::{aliases::Aliases, solve};
|
||||
|
@ -85,7 +83,7 @@ pub struct SolveConfig<'a> {
|
|||
|
||||
/// Module params
|
||||
pub params_pattern: Option<roc_can::pattern::Pattern>,
|
||||
pub module_params_vars: HashMap<ModuleId, Variable>,
|
||||
pub module_params_vars: VecMap<ModuleId, Variable>,
|
||||
}
|
||||
|
||||
pub struct SolveOutput {
|
||||
|
@ -163,9 +161,8 @@ pub fn exposed_types_storage_subs(
|
|||
stored_vars_by_symbol.insert(*symbol, new_var);
|
||||
}
|
||||
|
||||
if let Some(params_var) = params_var {
|
||||
storage_subs.import_variable_from(subs, params_var);
|
||||
}
|
||||
let stored_params_var =
|
||||
params_var.map(|params_var| storage_subs.import_variable_from(subs, params_var).variable);
|
||||
|
||||
let mut stored_specialization_lambda_set_vars =
|
||||
VecMap::with_capacity(solved_implementations.len());
|
||||
|
@ -224,6 +221,7 @@ pub fn exposed_types_storage_subs(
|
|||
stored_vars_by_symbol,
|
||||
stored_specialization_lambda_set_vars,
|
||||
stored_ability_member_vars,
|
||||
stored_params_var,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use crate::ability::{
|
||||
resolve_ability_specialization, type_implementing_specialization, AbilityImplError,
|
||||
CheckedDerives, ObligationCache, PendingDerivesTable, Resolved,
|
||||
|
@ -18,6 +16,7 @@ use roc_can::abilities::{AbilitiesStore, MemberSpecializationInfo};
|
|||
use roc_can::constraint::Constraint::{self, *};
|
||||
use roc_can::constraint::{Cycle, LetConstraint, OpportunisticResolve};
|
||||
use roc_can::expected::{Expected, PExpected};
|
||||
use roc_collections::VecMap;
|
||||
use roc_debug_flags::dbg_do;
|
||||
#[cfg(debug_assertions)]
|
||||
use roc_debug_flags::ROC_VERIFY_RIGID_LET_GENERALIZED;
|
||||
|
@ -245,7 +244,7 @@ fn solve(
|
|||
obligation_cache: &mut ObligationCache,
|
||||
awaiting_specializations: &mut AwaitingSpecializations,
|
||||
params_pattern: Option<roc_can::pattern::Pattern>,
|
||||
module_params_vars: HashMap<ModuleId, Variable>,
|
||||
module_params_vars: VecMap<ModuleId, Variable>,
|
||||
) -> State {
|
||||
let scope = Scope::new(params_pattern);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue