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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202104092013.139KDXY0024797%40masaka.moolenaar.net.

Raspunde prin e-mail lui