Patch 8.2.1132
Problem:    Vim9: return type of repeat() 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.1131/src/evalfunc.c      2020-07-01 18:29:23.685143414 +0200
--- src/evalfunc.c      2020-07-05 15:57:48.178291928 +0200
***************
*** 815,824 ****
      {"remote_peek",   1, 2, FEARG_1,    ret_number,   f_remote_peek},
      {"remote_read",   1, 2, FEARG_1,    ret_string,   f_remote_read},
      {"remote_send",   2, 3, FEARG_1,    ret_string,   f_remote_send},
!     {"remote_startserver", 1, 1, FEARG_1, ret_void,    f_remote_startserver},
      {"remove",                2, 3, FEARG_1,    ret_any,      f_remove},
      {"rename",                2, 2, FEARG_1,    ret_number,   f_rename},
!     {"repeat",                2, 2, FEARG_1,    ret_any,      f_repeat},
      {"resolve",               1, 1, FEARG_1,    ret_string,   f_resolve},
      {"reverse",               1, 1, FEARG_1,    ret_any,      f_reverse},
      {"round",         1, 1, FEARG_1,    ret_float,    FLOAT_FUNC(f_round)},
--- 815,824 ----
      {"remote_peek",   1, 2, FEARG_1,    ret_number,   f_remote_peek},
      {"remote_read",   1, 2, FEARG_1,    ret_string,   f_remote_read},
      {"remote_send",   2, 3, FEARG_1,    ret_string,   f_remote_send},
!     {"remote_startserver", 1, 1, FEARG_1, ret_void,   f_remote_startserver},
      {"remove",                2, 3, FEARG_1,    ret_any,      f_remove},
      {"rename",                2, 2, FEARG_1,    ret_number,   f_rename},
!     {"repeat",                2, 2, FEARG_1,    ret_first_arg, f_repeat},
      {"resolve",               1, 1, FEARG_1,    ret_string,   f_resolve},
      {"reverse",               1, 1, FEARG_1,    ret_any,      f_reverse},
      {"round",         1, 1, FEARG_1,    ret_float,    FLOAT_FUNC(f_round)},
*** ../vim-8.2.1131/src/testdir/test_vim9_func.vim      2020-07-05 
15:52:14.859511232 +0200
--- src/testdir/test_vim9_func.vim      2020-07-05 16:00:25.561713299 +0200
***************
*** 596,601 ****
--- 596,609 ----
    assert_equal(13, funcResult)
  enddef
  
+ def Test_repeat_return_type()
+   let res = 0
+   for n in repeat([1], 3)
+     res += n
+   endfor
+   assert_equal(3, res)
+ enddef
+ 
  def Test_func_type_part()
    let RefVoid: func: void
    RefVoid = FuncNoArgNoRet
*** ../vim-8.2.1131/src/version.c       2020-07-05 15:52:14.859511232 +0200
--- src/version.c       2020-07-05 15:58:41.214097085 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1132,
  /**/

-- 
BEDEVERE:        And what do you burn, apart from witches?
FOURTH VILLAGER: ... Wood?
BEDEVERE:        So why do witches burn?
SECOND VILLAGER: (pianissimo) ... Because they're made of wood...?
                 "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/202007051409.065E9Ou8580735%40masaka.moolenaar.net.

Raspunde prin e-mail lui