# HG changeset patch # User Bram Moolenaar # Date 1595781003 -7200 # Node ID 179697662a5a9db7834ca4442954fe8a9f9e79c8 # Parent 725efd0a47c7e88191f55dd5c17351a126fe7782 patch 8.2.1301: Vim9: varargs argument type not parsed properly Commit: https://github.com/vim/vim/commit/ace6132aa8c5fce9d4965e1f2e3a42071815b9de Author: Bram Moolenaar Date: Sun Jul 26 18:16:58 2020 +0200 patch 8.2.1301: Vim9: varargs argument type not parsed properly Problem: Vim9: varargs argument type not parsed properly. Solution: Skip over the "...". (issue https://github.com/vim/vim/issues/6507) diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -363,6 +363,19 @@ def Test_call_funcref() assert_equal(123, g:echo) END CheckScriptSuccess(lines) + + lines =<< trim END + vim9script + def EchoList(...l: list) + g:echo = l + enddef + let Funcref: func(...list) = 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') diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1301, +/**/ 1300, /**/ 1299, diff --git a/src/vim9compile.c b/src/vim9compile.c --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -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