diff src/vim9compile.c @ 21504:e87a97868bbc v8.2.1302

patch 8.2.1302: Vim9: varargs arg after optional arg does not work Commit: https://github.com/vim/vim/commit/01865ade85d2508639e24aaca5948b09fb284a82 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 26 18:33:09 2020 +0200 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 https://github.com/vim/vim/issues/6507)
author Bram Moolenaar <Bram@vim.org>
date Sun, 26 Jul 2020 18:45:06 +0200
parents 179697662a5a
children 81c47a694479
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2106,16 +2106,16 @@ parse_type(char_u **arg, garray_T *type_
 				first_optional = argcount;
 			    ++p;
 			}
+			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;
 			}
-			else if (STRNCMP(p, "...", 3) == 0)
-			{
-			    flags |= TTFLAG_VARARGS;
-			    p += 3;
-			}
 
 			arg_type[argcount++] = parse_type(&p, type_gap);