Patch 8.2.1144
Problem: Vim9: return type of reverse() is any.
Solution: Use the type of the first argument.
Files: src/evalfunc.c, src/testdir/test_vim9_func.vim
*** ../vim-8.2.1143/src/evalfunc.c 2020-07-05 20:55:25.989139371 +0200
--- src/evalfunc.c 2020-07-05 20:58:00.628515650 +0200
***************
*** 842,848 ****
{"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)},
{"rubyeval", 1, 1, FEARG_1, ret_any,
#ifdef FEAT_RUBY
--- 842,848 ----
{"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_first_arg, f_reverse},
{"round", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_round)},
{"rubyeval", 1, 1, FEARG_1, ret_any,
#ifdef FEAT_RUBY
*** ../vim-8.2.1143/src/testdir/test_vim9_func.vim 2020-07-05
20:55:25.989139371 +0200
--- src/testdir/test_vim9_func.vim 2020-07-05 20:58:30.884394917 +0200
***************
*** 927,932 ****
--- 927,941 ----
assert_equal(6, res)
enddef
+ def Test_reverse_return_type()
+ let l = reverse([1, 2, 3])
+ let res = 0
+ for n in l
+ res += n
+ endfor
+ assert_equal(6, res)
+ enddef
+
def Test_remove_return_type()
let l = remove(#{one: [1, 2], two: [3, 4]}, 'one')
let res = 0
*** ../vim-8.2.1143/src/version.c 2020-07-05 20:55:25.989139371 +0200
--- src/version.c 2020-07-05 20:59:18.416205991 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1144,
/**/
--
Managers are like cats in a litter box. They instinctively shuffle things
around to conceal what they've done.
(Scott Adams - The Dilbert principle)
/// 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/202007051911.065JBJKB652405%40masaka.moolenaar.net.