To: vim_dev@googlegroups.com Subject: Patch 8.2.2741 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2741 Problem: Vim9: Partial call does not check right arguments. Solution: Adjust the offset for whether the partial is before or after the arguments. (closes #8091) Files: src/vim9compile.c, src/testdir/test_vim9_func.vim *** ../vim-8.2.2740/src/vim9compile.c 2021-04-09 20:22:57.843301002 +0200 --- src/vim9compile.c 2021-04-09 21:58:43.239560818 +0200 *************** *** 1969,1975 **** for (i = 0; i < argcount; ++i) { ! int offset = -argcount + i - 1; type_T *actual = ((type_T **)stack->ga_data)[ stack->ga_len + offset]; type_T *expected; --- 1969,1975 ---- for (i = 0; i < argcount; ++i) { ! int offset = -argcount + i - (at_top ? 0 : 1); type_T *actual = ((type_T **)stack->ga_data)[ stack->ga_len + offset]; type_T *expected; *** ../vim-8.2.2740/src/testdir/test_vim9_func.vim 2021-04-09 20:22:57.843301002 +0200 --- src/testdir/test_vim9_func.vim 2021-04-09 22:02:11.018983494 +0200 *************** *** 796,801 **** --- 796,803 ---- assert_equal('anything', Callback()) assert_equal('anything', Callback(1)) assert_equal('anything', Callback('a', 2)) + + assert_equal('xyz', ((a: string): string => a)('xyz')) END CheckDefAndScriptSuccess(lines) *** ../vim-8.2.2740/src/version.c 2021-04-09 20:22:57.843301002 +0200 --- src/version.c 2021-04-09 22:00:02.247338546 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2741, /**/ -- From "know your smileys": :-O>-o Smiley American tourist (note big mouth and camera) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///