From: Mark Date: Thu, 29 Feb 2024 03:35:38 +0000 (-0700) Subject: issue callable type error from dynamic_module_resolution if module is not an atom... X-Git-Tag: v0.9.4~2 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=ba362e2fe071a862a2733d24f49c4b20b698faf0;p=scryer-prolog.git issue callable type error from dynamic_module_resolution if module is not an atom (#2345) --- diff --git a/src/lib/debug.pl b/src/lib/debug.pl index e237d8e1..702947fa 100644 --- a/src/lib/debug.pl +++ b/src/lib/debug.pl @@ -53,5 +53,4 @@ $(G_0) :- % % Generalize away Goal. - *(_). diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index fb3ecc1d..7efcc2df 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -1693,7 +1693,10 @@ impl Machine { } } _ => { - unreachable!() + let call_form = functor!(atom!(":"), [cell(module_name), cell(self.machine_st.registers[2])]); + let stub = functor_stub(atom!("call"), narity + 1); + let err = self.machine_st.type_error(ValidType::Callable, call_form); + return Err(self.machine_st.error_form(err, stub)); } );