mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-16 01:50:15 +00:00
Push checkmate through env
This commit is contained in:
parent
8097ee3342
commit
87d108eccc
16 changed files with 190 additions and 29 deletions
|
@ -1,5 +1,6 @@
|
|||
use roc_can::abilities::AbilitiesStore;
|
||||
use roc_can::expr::PendingDerives;
|
||||
use roc_checkmate::with_checkmate;
|
||||
use roc_collections::{VecMap, VecSet};
|
||||
use roc_debug_flags::dbg_do;
|
||||
#[cfg(debug_assertions)]
|
||||
|
@ -18,8 +19,9 @@ use roc_types::subs::{
|
|||
TupleElems, Variable,
|
||||
};
|
||||
use roc_types::types::{AliasKind, Category, MemberImpl, PatternCategory, Polarity, Types};
|
||||
use roc_unify::unify::{Env as UEnv, MustImplementConstraints};
|
||||
use roc_unify::unify::MustImplementConstraints;
|
||||
use roc_unify::unify::{MustImplementAbility, Obligated};
|
||||
use roc_unify::Env as UEnv;
|
||||
|
||||
use crate::env::InferenceEnv;
|
||||
use crate::{aliases::Aliases, to_var::type_to_var};
|
||||
|
@ -1289,9 +1291,12 @@ impl DerivableVisitor for DeriveEq {
|
|||
|
||||
// Of the floating-point types,
|
||||
// only Dec implements Eq.
|
||||
let mut env = UEnv::new(subs);
|
||||
// TODO(checkmate): pass checkmate through
|
||||
let unified = unify(
|
||||
&mut env,
|
||||
&mut with_checkmate!(None, {
|
||||
on => UEnv::new(subs, None),
|
||||
off => UEnv::new(subs),
|
||||
}),
|
||||
content_var,
|
||||
Variable::DECIMAL,
|
||||
Mode::EQ,
|
||||
|
@ -1423,7 +1428,11 @@ pub fn resolve_ability_specialization<R: AbilityResolver>(
|
|||
|
||||
instantiate_rigids(subs, signature_var);
|
||||
let (_vars, must_implement_ability, _lambda_sets_to_specialize, _meta) = unify(
|
||||
&mut UEnv::new(subs),
|
||||
// TODO(checkmate): pass checkmate through
|
||||
&mut with_checkmate!(None, {
|
||||
on => UEnv::new(subs, None),
|
||||
off => UEnv::new(subs),
|
||||
}),
|
||||
specialization_var,
|
||||
signature_var,
|
||||
Mode::EQ,
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
use bumpalo::Bump;
|
||||
use roc_can::{constraint::Constraints, module::ExposedByModule};
|
||||
use roc_checkmate::with_checkmate;
|
||||
use roc_derive::SharedDerivedModule;
|
||||
use roc_types::subs::{Content, Descriptor, Mark, OptVariable, Rank, Subs, Variable};
|
||||
use roc_unify::unify::Env as UEnv;
|
||||
use roc_unify::Env as UEnv;
|
||||
|
||||
use crate::{FunctionKind, Pools};
|
||||
|
||||
|
@ -93,7 +94,11 @@ impl<'a> InferenceEnv<'a> {
|
|||
|
||||
/// Retrieves an environment for unification.
|
||||
pub fn uenv(&mut self) -> UEnv {
|
||||
UEnv::new(self.subs)
|
||||
// TODO(checkmate): pass checkmate through
|
||||
with_checkmate!(None, {
|
||||
on => UEnv::new(self.subs, None),
|
||||
off => UEnv::new(self.subs),
|
||||
})
|
||||
}
|
||||
|
||||
pub fn as_solve_env(&mut self) -> SolveEnv {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue