From 94fe68aedc284cf2a629ccc0bdb62a5b4e9ab0bf Mon Sep 17 00:00:00 2001 From: ctsk <9384305+ctsk@users.noreply.github.com> Date: Sat, 21 Oct 2023 12:16:17 +0200 Subject: [PATCH] [rlox] Error when add operands are of wrong types --- rlox/src/vm.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rlox/src/vm.rs b/rlox/src/vm.rs index a43b0d9..3c357ec 100644 --- a/rlox/src/vm.rs +++ b/rlox/src/vm.rs @@ -117,7 +117,7 @@ impl VM { } }? } - _ => todo!() + _ => return Err(VMError::Runtime("Operands of + need to be numbers or strings".into(), self.pc)) }; } Op::Subtract | Op::Multiply | Op::Divide => {