Interpreter - Handle errors for multiple definitions of an argument
This commit is contained in:
parent
7b20ec2f3a
commit
cf3284cd88
1 changed files with 2 additions and 1 deletions
|
@ -47,7 +47,8 @@ impl Callable for Function {
|
||||||
assert_eq!(arguments.len(), self.arity());
|
assert_eq!(arguments.len(), self.arity());
|
||||||
let param_env = Environment::create_child(environment);
|
let param_env = Environment::create_child(environment);
|
||||||
for (arg, value) in izip!(self.params.iter(), arguments.into_iter()) {
|
for (arg, value) in izip!(self.params.iter(), arguments.into_iter()) {
|
||||||
param_env.borrow_mut().define(&arg, Some(value));
|
// FIXME: duplicate parameter names should be detected in the parser
|
||||||
|
param_env.borrow_mut().define(&arg, Some(value))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let child = Environment::create_child(¶m_env);
|
let child = Environment::create_child(¶m_env);
|
||||||
|
|
Loading…
Reference in a new issue