From ba362e2fe071a862a2733d24f49c4b20b698faf0 Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 28 Feb 2024 20:35:38 -0700 Subject: [PATCH] issue callable type error from dynamic_module_resolution if module is not an atom (#2345) --- src/lib/debug.pl | 1 - src/machine/system_calls.rs | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) 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)); } ); -- 2.54.0