diff --git a/src/protocol/eval/executor.rs b/src/protocol/eval/executor.rs index 49f04a23fc0f9ac0c7a3908d7c29b02c7c17b4d9..18de494a20c56c87ca3744076a9517f205d1676f 100644 --- a/src/protocol/eval/executor.rs +++ b/src/protocol/eval/executor.rs @@ -498,7 +498,15 @@ impl Prompt { // Typechecking reduced this to two cases: either we // have casting noop (same types), or we're casting // between integer/bool/char types. + let subject = cur_frame.expr_values.pop_back().unwrap(); + match apply_casting(&mut self.store, output_type, &subject) { + Ok(value) => cur_frame.expr_values.push_back(value), + Err(msg) => { + return Err(EvalError::new_error_at_expr(self, modules, heap, expr.this.upcast(), msg)); + } + } + self.store.drop_value(subject.get_heap_pos()); } Expression::Call(expr) => { // Push a new frame. Note that all expressions have