0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.1143: Vim9: return type of remove() is any

Problem:    Vim9: return type of remove() is any.
Solution:   Use the member type of the first argument, if known.
This commit is contained in:
Bram Moolenaar
2020-07-05 20:55:29 +02:00
parent 252e88a785
commit ad7c249327
3 changed files with 23 additions and 1 deletions

View File

@@ -927,6 +927,15 @@ def Test_insert_return_type()
assert_equal(6, res)
enddef
def Test_remove_return_type()
let l = remove(#{one: [1, 2], two: [3, 4]}, 'one')
let res = 0
for n in l
res += n
endfor
assert_equal(3, res)
enddef
def Test_filter_return_type()
let l = filter([1, 2, 3], {-> 1})
let res = 0