mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Fix types
This commit is contained in:
parent
54e8d1d908
commit
8b7823a237
5 changed files with 26 additions and 3 deletions
|
@ -242,6 +242,20 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ErasedLambda"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
|
|
@ -76,6 +76,7 @@ impl AsSchema<Content> for subs::Content {
|
|||
opt_name,
|
||||
} => B::Recursive(opt_name.as_schema(subs), structure.as_schema(subs)),
|
||||
A::LambdaSet(lambda_set) => lambda_set.as_schema(subs),
|
||||
A::ErasedLambda => B::ErasedLambda(),
|
||||
A::Structure(flat_type) => flat_type.as_schema(subs),
|
||||
A::Alias(name, type_vars, real_var, kind) => B::Alias(
|
||||
name.as_schema(subs),
|
||||
|
|
|
@ -58,6 +58,7 @@ impl_content! {
|
|||
recursion_var: Option<Variable>,
|
||||
ambient_function: Variable,
|
||||
},
|
||||
ErasedLambda {},
|
||||
Alias {
|
||||
name: Symbol,
|
||||
variables: AliasTypeVariables,
|
||||
|
|
|
@ -397,7 +397,7 @@ pub fn unify(
|
|||
pools: &mut pools,
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
checkmate: None,
|
||||
checkmate: &mut None,
|
||||
};
|
||||
|
||||
compact_lambda_sets_of_vars(&mut env, lambda_sets_to_specialize, &late_phase)
|
||||
|
|
|
@ -20,7 +20,7 @@ pub struct SolveEnv<'a> {
|
|||
pub subs: &'a mut Subs,
|
||||
pub pools: &'a mut Pools,
|
||||
#[cfg(debug_assertions)]
|
||||
pub checkmate: Option<roc_checkmate::Collector>,
|
||||
pub checkmate: &'a mut Option<roc_checkmate::Collector>,
|
||||
}
|
||||
|
||||
/// Environment necessary for inference.
|
||||
|
@ -31,6 +31,8 @@ pub struct InferenceEnv<'a> {
|
|||
pub derived_env: &'a DerivedEnv<'a>,
|
||||
pub subs: &'a mut Subs,
|
||||
pub pools: &'a mut Pools,
|
||||
#[cfg(debug_assertions)]
|
||||
pub checkmate: Option<roc_checkmate::Collector>,
|
||||
}
|
||||
|
||||
impl<'a> SolveEnv<'a> {
|
||||
|
@ -42,7 +44,10 @@ impl<'a> SolveEnv<'a> {
|
|||
|
||||
/// Retrieves an environment for unification.
|
||||
pub fn uenv(&mut self) -> UEnv {
|
||||
UEnv::new(self.subs)
|
||||
with_checkmate!({
|
||||
on => UEnv::new(self.subs, self.checkmate.as_mut()),
|
||||
off => UEnv::new(self.subs),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,6 +113,8 @@ impl<'a> InferenceEnv<'a> {
|
|||
derived_env: self.derived_env,
|
||||
subs: self.subs,
|
||||
pools: self.pools,
|
||||
#[cfg(debug_assertions)]
|
||||
checkmate: &mut self.checkmate,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue