Throw ValidType::Atom error in functor

This commit is contained in:
Adrián Arroyo Calle
2023-12-17 12:38:46 +01:00
parent a66b93c96f
commit d132227860

View File

@@ -1450,10 +1450,15 @@ impl MachineState {
a1.as_var().unwrap(), a1.as_var().unwrap(),
); );
} }
(HeapCellValueTag::Cons | HeapCellValueTag::Fixnum |
HeapCellValueTag::F64) if arity != 0 => {
let err = self.type_error(ValidType::Atom, store_name);
return Err(self.error_form(err, stub_gen())); // 8.5.1.3 e)
}
_ => { _ => {
let err = self.type_error(ValidType::Atomic, store_name); let err = self.type_error(ValidType::Atomic, store_name);
return Err(self.error_form(err, stub_gen())); return Err(self.error_form(err, stub_gen())); // 8.5.1.3 c)
} // 8.5.1.3 c) }
); );
} }
_ => { _ => {