To: vim_dev@googlegroups.com Subject: Patch 8.2.1301 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1301 Problem: Vim9: varargs argument type not parsed properly. Solution: Skip over the "...". (issue #6507) Files: src/vim9compile.c, src/testdir/test_vim9_func.vim *** ../vim-8.2.1300/src/vim9compile.c 2020-07-26 17:56:20.448638742 +0200 --- src/vim9compile.c 2020-07-26 18:14:24.393601681 +0200 *************** *** 1956,1961 **** --- 1956,1963 ---- { char_u *sp = p; + if (STRNCMP(p, "...", 3) == 0) + p += 3; p = skip_type(p, TRUE); if (p == sp) return p; // syntax error *** ../vim-8.2.1300/src/testdir/test_vim9_func.vim 2020-07-26 17:56:20.448638742 +0200 --- src/testdir/test_vim9_func.vim 2020-07-26 18:16:05.009243319 +0200 *************** *** 363,368 **** --- 363,381 ---- 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') *** ../vim-8.2.1300/src/version.c 2020-07-26 17:56:20.448638742 +0200 --- src/version.c 2020-07-26 18:16:46.993092214 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1301, /**/ -- In order for something to become clean, something else must become dirty; but you can get everything dirty without getting anything clean. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///