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:
@@ -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>)
|
||||
|
@@ -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;
|
||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1723,
|
||||
/**/
|
||||
1722,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user