forked from aniani/vim
patch 8.2.1144: Vim9: return type of reverse() is any
Problem: Vim9: return type of reverse() is any. Solution: Use the type of the first argument.
This commit is contained in:
@@ -927,6 +927,15 @@ def Test_insert_return_type()
|
||||
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
|
||||
|
Reference in New Issue
Block a user