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

patch 8.2.1141: Vim9: return type of filter() is any

Problem:    Vim9: return type of filter() is any.
Solution:   Use type of the argument.
This commit is contained in:
Bram Moolenaar
2020-07-05 20:16:41 +02:00
parent b3c019cbc3
commit 0d94ad6958
3 changed files with 12 additions and 1 deletions

View File

@@ -918,6 +918,15 @@ def Test_extend_return_type()
assert_equal(6, res)
enddef
def Test_filter_return_type()
let l = filter([1, 2, 3], {-> 1})
let res = 0
for n in l
res += n
endfor
assert_equal(6, res)
enddef
def Line_continuation_in_def(dir: string = ''): string
let path: string = empty(dir)
\ ? 'empty'