From: Mark Thom Date: Sat, 19 Feb 2022 02:33:16 +0000 (-0700) Subject: throw instantiation_error on variables from (#1283) X-Git-Tag: v0.9.0^2~20 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=d3583276b3f741f39408631cfcc6d4227da17b0f;p=scryer-prolog.git throw instantiation_error on variables from (#1283) --- diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index ef548a2e..647d4d14 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -2925,8 +2925,14 @@ impl Machine { let key = (self.machine_st.atom_tbl.build_with(&c.to_string()), narity); Ok((module_name, key)) } + (HeapCellValueTag::AttrVar | HeapCellValueTag::StackVar | HeapCellValueTag::Var) => { + let stub = functor_stub(atom!("call"), 1); + let err = self.machine_st.instantiation_error(); + + Err(self.machine_st.error_form(err, stub)) + } _ => { - let stub = functor_stub(atom!("(:)"), 2); + let stub = functor_stub(atom!("call"), narity); let err = self.machine_st.type_error(ValidType::Callable, addr); Err(self.machine_st.error_form(err, stub))