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:
@@ -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
|
||||
|
Reference in New Issue
Block a user