Skip to content

Commit ba362e2

Browse files
committed
issue callable type error from dynamic_module_resolution if module is not an atom (#2345)
1 parent 84d5ce0 commit ba362e2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/lib/debug.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,4 @@
5353
%
5454
% Generalize away Goal.
5555

56-
5756
*(_).

src/machine/system_calls.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,10 @@ impl Machine {
16931693
}
16941694
}
16951695
_ => {
1696-
unreachable!()
1696+
let call_form = functor!(atom!(":"), [cell(module_name), cell(self.machine_st.registers[2])]);
1697+
let stub = functor_stub(atom!("call"), narity + 1);
1698+
let err = self.machine_st.type_error(ValidType::Callable, call_form);
1699+
return Err(self.machine_st.error_form(err, stub));
16971700
}
16981701
);
16991702

0 commit comments

Comments
 (0)