Mercurial > vim
changeset 21502:179697662a5a v8.2.1301
patch 8.2.1301: Vim9: varargs argument type not parsed properly
Commit: https://github.com/vim/vim/commit/ace6132aa8c5fce9d4965e1f2e3a42071815b9de
Author: Bram Moolenaar <Bram@vim.org>
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 26 Jul 2020 18:30:03 +0200 |
parents | 725efd0a47c7 |
children | e10b92dd259f |
files | src/testdir/test_vim9_func.vim src/version.c src/vim9compile.c |
diffstat | 3 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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<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')