mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.1142: Vim9: return type of insert() is any
Problem: Vim9: return type of insert() is any. Solution: Use type of the first argument.
This commit is contained in:
parent
0d94ad6958
commit
252e88a785
@ -667,7 +667,7 @@ static funcentry_T global_functions[] =
|
||||
{"inputrestore", 0, 0, 0, ret_number, f_inputrestore},
|
||||
{"inputsave", 0, 0, 0, ret_number, f_inputsave},
|
||||
{"inputsecret", 1, 2, FEARG_1, ret_string, f_inputsecret},
|
||||
{"insert", 2, 3, FEARG_1, ret_any, f_insert},
|
||||
{"insert", 2, 3, FEARG_1, ret_first_arg, f_insert},
|
||||
{"interrupt", 0, 0, 0, ret_void, f_interrupt},
|
||||
{"invert", 1, 1, FEARG_1, ret_number, f_invert},
|
||||
{"isdirectory", 1, 1, FEARG_1, ret_number, f_isdirectory},
|
||||
|
@ -918,6 +918,15 @@ def Test_extend_return_type()
|
||||
assert_equal(6, res)
|
||||
enddef
|
||||
|
||||
def Test_insert_return_type()
|
||||
let l = insert([2, 1], 3)
|
||||
let res = 0
|
||||
for n in l
|
||||
res += n
|
||||
endfor
|
||||
assert_equal(6, res)
|
||||
enddef
|
||||
|
||||
def Test_filter_return_type()
|
||||
let l = filter([1, 2, 3], {-> 1})
|
||||
let res = 0
|
||||
|
@ -754,6 +754,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1142,
|
||||
/**/
|
||||
1141,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user