]> Repositorios git - scryer-prolog.git/commitdiff
throw instantiation_error on variables from (#1283)
authorMark Thom <[email protected]>
Sat, 19 Feb 2022 02:33:16 +0000 (19:33 -0700)
committerMark Thom <[email protected]>
Sat, 19 Feb 2022 08:00:02 +0000 (01:00 -0700)
src/machine/system_calls.rs

index ef548a2e22df328f577bf62e03618cff35161956..647d4d149e92bd170e7ddc821269b4b93d3ec61e 100644 (file)
@@ -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))