function.go: if the right most parameter is repeteable (pfRepeat), then it does not increment the min-arg count
This commit is contained in:
parent
c04678c426
commit
e4b4b4fb79
@ -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())
|
||||
}
|
||||
if p.IsRepeat() {
|
||||
minArgs--
|
||||
maxArgs = -1
|
||||
}
|
||||
}
|
||||
@ -221,7 +222,7 @@ func (info *funcInfo) ToString(opt FmtOpt) string {
|
||||
if info.maxArgs < 0 {
|
||||
sb.WriteString(" ...")
|
||||
}
|
||||
sb.WriteString("): ")
|
||||
sb.WriteString("):")
|
||||
if len(info.returnType) > 0 {
|
||||
sb.WriteString(info.returnType)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user