From: Mark Date: Thu, 29 Feb 2024 03:47:36 +0000 (-0700) Subject: fix misuse of TypeError trait while fixing #2345 X-Git-Tag: v0.9.4~1 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=641765858f104ed9a87ed78dbf9d9298a6996853;p=scryer-prolog.git fix misuse of TypeError trait while fixing #2345 --- diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index 7efcc2df..86d7944a 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -1693,9 +1693,12 @@ impl Machine { } } _ => { + let h = self.machine_st.heap.len(); let call_form = functor!(atom!(":"), [cell(module_name), cell(self.machine_st.registers[2])]); + self.machine_st.heap.extend(call_form); + let stub = functor_stub(atom!("call"), narity + 1); - let err = self.machine_st.type_error(ValidType::Callable, call_form); + let err = self.machine_st.type_error(ValidType::Callable, str_loc_as_cell!(h)); return Err(self.machine_st.error_form(err, stub)); } );