Assert against inconsistent numbers of arguments
This commit is contained in:
parent
88274e4396
commit
09e16edbe4
@ -225,6 +225,9 @@ impl Function
|
|||||||
{
|
{
|
||||||
pub fn new(declaration: &std::rc::Rc<FunctionDeclaration>, arguments: Vec<Box<Term>>) -> Self
|
pub fn new(declaration: &std::rc::Rc<FunctionDeclaration>, arguments: Vec<Box<Term>>) -> Self
|
||||||
{
|
{
|
||||||
|
assert_eq!(declaration.arity, arguments.len(),
|
||||||
|
"function has a different number of arguments then declared");
|
||||||
|
|
||||||
Self
|
Self
|
||||||
{
|
{
|
||||||
declaration: std::rc::Rc::clone(declaration),
|
declaration: std::rc::Rc::clone(declaration),
|
||||||
@ -377,6 +380,9 @@ impl Predicate
|
|||||||
{
|
{
|
||||||
pub fn new(declaration: &std::rc::Rc<PredicateDeclaration>, arguments: Vec<Box<Term>>) -> Self
|
pub fn new(declaration: &std::rc::Rc<PredicateDeclaration>, arguments: Vec<Box<Term>>) -> Self
|
||||||
{
|
{
|
||||||
|
assert_eq!(declaration.arity, arguments.len(),
|
||||||
|
"predicate has a different number of arguments then declared");
|
||||||
|
|
||||||
Self
|
Self
|
||||||
{
|
{
|
||||||
declaration: std::rc::Rc::clone(declaration),
|
declaration: std::rc::Rc::clone(declaration),
|
||||||
|
Loading…
Reference in New Issue
Block a user