Patch 8.2.1133
Problem:    Vim9: return type of add() is not specific enough.
Solution:   Return the type of the first argument. (closes #6395)
Files:      src/evalfunc.c, src/testdir/test_vim9_func.vim


*** ../vim-8.2.1132/src/evalfunc.c      2020-07-05 16:01:52.709392389 +0200
--- src/evalfunc.c      2020-07-05 16:06:17.973094738 +0200
***************
*** 441,447 ****
  {
      {"abs",           1, 1, FEARG_1,    ret_any,      FLOAT_FUNC(f_abs)},
      {"acos",          1, 1, FEARG_1,    ret_float,    FLOAT_FUNC(f_acos)},
!     {"add",           2, 2, FEARG_1,    ret_any,      f_add},
      {"and",           2, 2, FEARG_1,    ret_number,   f_and},
      {"append",                2, 2, FEARG_LAST, ret_number,   f_append},
      {"appendbufline", 3, 3, FEARG_LAST, ret_number,   f_appendbufline},
--- 441,447 ----
  {
      {"abs",           1, 1, FEARG_1,    ret_any,      FLOAT_FUNC(f_abs)},
      {"acos",          1, 1, FEARG_1,    ret_float,    FLOAT_FUNC(f_acos)},
!     {"add",           2, 2, FEARG_1,    ret_first_arg, f_add},
      {"and",           2, 2, FEARG_1,    ret_number,   f_and},
      {"append",                2, 2, FEARG_LAST, ret_number,   f_append},
      {"appendbufline", 3, 3, FEARG_LAST, ret_number,   f_appendbufline},
*** ../vim-8.2.1132/src/testdir/test_vim9_func.vim      2020-07-05 
16:01:52.709392389 +0200
--- src/testdir/test_vim9_func.vim      2020-07-05 16:05:55.529082326 +0200
***************
*** 602,607 ****
--- 602,613 ----
      res += n
    endfor
    assert_equal(3, res)
+ 
+   res = 0
+   for n in add([1, 2], 3)
+     res += n
+   endfor
+   assert_equal(6, res)
  enddef
  
  def Test_func_type_part()
*** ../vim-8.2.1132/src/version.c       2020-07-05 16:01:52.709392389 +0200
--- src/version.c       2020-07-05 16:06:49.941106707 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1133,
  /**/

-- 
BEDEVERE: Wait.  Wait ... tell me, what also floats on water?
ALL:      Bread?  No, no, no.  Apples .... gravy ... very small rocks ...
ARTHUR:   A duck.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- 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    ///

-- 
-- 
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/202007051410.065EA35N580860%40masaka.moolenaar.net.

Raspunde prin e-mail lui