From: Mark Thom Date: Sat, 23 May 2020 19:33:05 +0000 (-0600) Subject: throw evaluable type error for unrecognized atoms in arith_eval_by_metacall X-Git-Tag: v0.8.127~65 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=15db77558c5b7c1a981eb9e15dacaeb393852d11;p=scryer-prolog.git throw evaluable type error for unrecognized atoms in arith_eval_by_metacall --- diff --git a/src/prolog/machine/arithmetic_ops.rs b/src/prolog/machine/arithmetic_ops.rs index 61627aa8..45aecb9b 100644 --- a/src/prolog/machine/arithmetic_ops.rs +++ b/src/prolog/machine/arithmetic_ops.rs @@ -269,6 +269,18 @@ impl MachineState { caller, )); } + &HeapCellValue::Atom(ref name, _) => { + let evaluable_stub = MachineError::functor_stub(name.clone(), 0); + + return Err(self.error_form( + MachineError::type_error( + self.heap.h(), + ValidType::Evaluable, + evaluable_stub, + ), + caller, + )); + } &HeapCellValue::Addr(addr) if addr.is_ref() => { return Err(self.error_form( MachineError::instantiation_error(),