mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
parent
229567293c
commit
1b3a03f161
1 changed files with 9 additions and 5 deletions
|
@ -765,11 +765,15 @@ void EvalState::callFunction(Value & fun, Value & arg, Value & v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check that each actual argument is listed as a formal
|
/* Check that each actual argument is listed as a formal
|
||||||
argument (unless the attribute match specifies a `...').
|
argument (unless the attribute match specifies a `...'). */
|
||||||
TODO: show the names of the expected/unexpected
|
if (!fun.lambda.fun->formals->ellipsis && attrsUsed != arg.attrs->size()) {
|
||||||
arguments. */
|
/* Nope, so show the first unexpected argument to the
|
||||||
if (!fun.lambda.fun->formals->ellipsis && attrsUsed != arg.attrs->size())
|
user. */
|
||||||
throwTypeError("function at %1% called with unexpected argument", fun.lambda.fun->pos);
|
foreach (Bindings::iterator, i, *arg.attrs)
|
||||||
|
if (fun.lambda.fun->formals->argNames.find(i->name) == fun.lambda.fun->formals->argNames.end())
|
||||||
|
throwTypeError("function at %1% called with unexpected argument `%2%'", fun.lambda.fun->pos, i->name);
|
||||||
|
abort(); // can't happen
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nrFunctionCalls++;
|
nrFunctionCalls++;
|
||||||
|
|
Loading…
Reference in a new issue