changeset 22349:b66a2e046c2e v8.2.1723

patch 8.2.1723: Vim9: Variable argument name cannot start with underscore Commit: https://github.com/vim/vim/commit/280227270c1c54794a6d88a305fac56d4b0c92a5 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 21 22:02:49 2020 +0200 patch 8.2.1723: Vim9: Variable argument name cannot start with underscore Problem: Vim9: Variable argument name cannot start with underscore. Solution: Use eval_isnamec1(). (closes https://github.com/vim/vim/issues/6988)
author Bram Moolenaar <Bram@vim.org>
date Mon, 21 Sep 2020 22:15:03 +0200
parents 267f3a1c5105
children 416fa143fa2d
files src/testdir/test_vim9_func.vim src/userfunc.c src/version.c
diffstat 3 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -374,6 +374,15 @@ def Test_call_def_varargs()
 
   lines =<< trim END
       vim9script
+      def Func(..._l: list<string>)
+        echo _l
+      enddef
+      Func('a', 'b', 'c')
+  END
+  CheckScriptSuccess(lines)
+
+  lines =<< trim END
+      vim9script
       def Func(...l: list<string>)
         echo l
       enddef
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -211,7 +211,7 @@ get_function_args(
 	    if (argtypes != NULL)
 	    {
 		// ...name: list<type>
-		if (!ASCII_ISALPHA(*p))
+		if (!eval_isnamec1(*p))
 		{
 		    emsg(_(e_missing_name_after_dots));
 		    break;
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1723,
+/**/
     1722,
 /**/
     1721,