function.go: if the right most parameter is repeteable (pfRepeat), then it does not increment the min-arg count

This commit is contained in:
Celestino Amoroso 2024-06-02 11:30:24 +02:00
parent c04678c426
commit e4b4b4fb79

View File

@ -168,6 +168,7 @@ func newFuncInfo(name string, functor Functor, returnType string, params []ExprF
return nil, fmt.Errorf("can't specify non-optional param after optional ones: %q", p.Name()) return nil, fmt.Errorf("can't specify non-optional param after optional ones: %q", p.Name())
} }
if p.IsRepeat() { if p.IsRepeat() {
minArgs--
maxArgs = -1 maxArgs = -1
} }
} }