Fixed a tricky type erasure bug in the scheduler

This commit is contained in:
2023-10-12 14:36:59 +01:00
parent af3e9f67fa
commit cb395da894
32 changed files with 147 additions and 125 deletions

View File

@@ -70,14 +70,12 @@ pub fn run_handler(
loop {
let mut ret = run(expr, ctx.clone())?;
let quit = take_with_output(&mut ret.state, |exi| match exi.expr_val() {
Expr { clause: Clause::Atom(a), .. } => {
match handlers.dispatch(a.0) {
Err(b) => (Clause::Atom(Atom(b)).wrap(), Ok(true)),
Ok(e) => match e {
Ok(expr) => (expr, Ok(false)),
Err(e) => (Clause::Bottom.wrap(), Err(e)),
},
}
Expr { clause: Clause::Atom(a), .. } => match handlers.dispatch(a.0) {
Err(b) => (Clause::Atom(Atom(b)).wrap(), Ok(true)),
Ok(e) => match e {
Ok(expr) => (expr, Ok(false)),
Err(e) => (Clause::Bottom.wrap(), Err(e)),
},
},
expr => (ExprInst::new(expr), Ok(true)),
})?;