mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.1301: Vim9: varargs argument type not parsed properly
Problem: Vim9: varargs argument type not parsed properly. Solution: Skip over the "...". (issue #6507)
This commit is contained in:
@@ -363,6 +363,19 @@ def Test_call_funcref()
|
||||
assert_equal(123, g:echo)
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
def EchoList(...l: list<number>)
|
||||
g:echo = l
|
||||
enddef
|
||||
let Funcref: func(...list<number>) = function('EchoList')
|
||||
Funcref()
|
||||
assert_equal([], g:echo)
|
||||
Funcref(1, 2, 3)
|
||||
assert_equal([1, 2, 3], g:echo)
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
let SomeFunc = function('len')
|
||||
|
@@ -754,6 +754,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1301,
|
||||
/**/
|
||||
1300,
|
||||
/**/
|
||||
|
@@ -1956,6 +1956,8 @@ skip_type(char_u *start, int optional)
|
||||
{
|
||||
char_u *sp = p;
|
||||
|
||||
if (STRNCMP(p, "...", 3) == 0)
|
||||
p += 3;
|
||||
p = skip_type(p, TRUE);
|
||||
if (p == sp)
|
||||
return p; // syntax error
|
||||
|
Reference in New Issue
Block a user