mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-07-01 16:31:16 -03:00
Fix error for vararg functions with zero arguments
This commit is contained in:
@@ -461,7 +461,9 @@ double state::base() {
|
||||
if (type_ != TOK_ERROR || error_ == TE_ERROR_UNEXPECTED_TOKEN) {
|
||||
// Otherwise we complain about the number of arguments *first*,
|
||||
// a closing parenthesis should be more obvious.
|
||||
error_ = i < arity ? TE_ERROR_TOO_FEW_ARGS : TE_ERROR_TOO_MANY_ARGS;
|
||||
//
|
||||
// Vararg functions need at least one argument.
|
||||
error_ = (i < arity || (arity == -1 && i == 0)) ? TE_ERROR_TOO_FEW_ARGS : TE_ERROR_TOO_MANY_ARGS;
|
||||
type_ = TOK_ERROR;
|
||||
if (first_err) {
|
||||
errpos_ = first_err;
|
||||
|
||||
Reference in New Issue
Block a user