mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Push checkmate through load
This commit is contained in:
parent
27dd9d03aa
commit
1282110ef5
14 changed files with 167 additions and 45 deletions
|
@ -1,3 +1,4 @@
|
|||
use crate::solve::RunSolveOutput;
|
||||
use crate::FunctionKind;
|
||||
use crate::{aliases::Aliases, solve};
|
||||
use roc_can::abilities::{AbilitiesStore, ResolvedImpl};
|
||||
|
@ -75,6 +76,10 @@ pub struct SolveConfig<'a> {
|
|||
/// Needed during solving to resolve lambda sets from derived implementations that escape into
|
||||
/// the user module.
|
||||
pub derived_module: SharedDerivedModule,
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
/// The checkmate collector for this module.
|
||||
pub checkmate: Option<roc_checkmate::Collector>,
|
||||
}
|
||||
|
||||
pub struct SolveOutput {
|
||||
|
@ -82,6 +87,9 @@ pub struct SolveOutput {
|
|||
pub scope: solve::Scope,
|
||||
pub errors: Vec<TypeError>,
|
||||
pub resolved_abilities_store: AbilitiesStore,
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
pub checkmate: Option<roc_checkmate::Collector>,
|
||||
}
|
||||
|
||||
pub fn run_solve(
|
||||
|
@ -108,7 +116,12 @@ pub fn run_solve(
|
|||
let mut problems = Vec::new();
|
||||
|
||||
// Run the solver to populate Subs.
|
||||
let (solved_subs, solved_scope) = solve::run(
|
||||
let RunSolveOutput {
|
||||
solved,
|
||||
scope,
|
||||
#[cfg(debug_assertions)]
|
||||
checkmate,
|
||||
} = solve::run(
|
||||
config,
|
||||
&mut problems,
|
||||
subs,
|
||||
|
@ -117,10 +130,12 @@ pub fn run_solve(
|
|||
);
|
||||
|
||||
SolveOutput {
|
||||
subs: solved_subs,
|
||||
scope: solved_scope,
|
||||
subs: solved,
|
||||
scope,
|
||||
errors: problems,
|
||||
resolved_abilities_store: abilities_store,
|
||||
#[cfg(debug_assertions)]
|
||||
checkmate,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue