0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

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 #6988)
This commit is contained in:
Bram Moolenaar
2020-09-21 22:02:49 +02:00
parent dbd759309b
commit 280227270c
3 changed files with 12 additions and 1 deletions

View File

@@ -372,6 +372,15 @@ def Test_call_def_varargs()
END
CheckScriptSuccess(lines)
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>)

View File

@@ -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;

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1723,
/**/
1722,
/**/