1
0
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:
Bram Moolenaar
2020-07-05 21:10:24 +02:00
parent ad7c249327
commit 67627355ac
3 changed files with 12 additions and 1 deletions

View File

@@ -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