1
0
forked from aniani/vim

patch 8.2.1302: Vim9: varargs arg after optional arg does not work

Problem:    Vim9: varargs arg after optional arg does not work
Solution:   Check for the "..." first. (issue #6507)
This commit is contained in:
Bram Moolenaar
2020-07-26 18:33:09 +02:00
parent ace6132aa8
commit 01865ade85
3 changed files with 29 additions and 5 deletions

View File

@@ -2106,16 +2106,16 @@ parse_type(char_u **arg, garray_T *type_gap)
first_optional = argcount;
++p;
}
else if (first_optional != -1)
{
emsg(_("E1007: mandatory argument after optional argument"));
return &t_any;
}
else if (STRNCMP(p, "...", 3) == 0)
{
flags |= TTFLAG_VARARGS;
p += 3;
}
else if (first_optional != -1)
{
emsg(_("E1007: mandatory argument after optional argument"));
return &t_any;
}
arg_type[argcount++] = parse_type(&p, type_gap);