hook everything up in the gen tests

This commit is contained in:
Folkert 2020-10-02 21:04:42 +02:00
parent 05d1f28e83
commit c00cd2f415
5 changed files with 47 additions and 18 deletions

View file

@ -157,6 +157,33 @@ pub fn run(
(Solved(subs), state.env)
}
/// Modify an existing subs in-place instead
pub fn run_in_place(
env: &Env,
problems: &mut Vec<TypeError>,
subs: &mut Subs,
constraint: &Constraint,
) -> Env {
let mut pools = Pools::default();
let state = State {
env: env.clone(),
mark: Mark::NONE.next(),
};
let rank = Rank::toplevel();
let state = solve(
env,
state,
rank,
&mut pools,
problems,
&mut MutMap::default(),
subs,
constraint,
);
state.env
}
#[allow(clippy::too_many_arguments)]
fn solve(
env: &Env,