diff src/testdir/test_vim9_func.vim @ 21180:dde4c2e84f5c v8.2.1141

patch 8.2.1141: Vim9: return type of filter() is any Commit: https://github.com/vim/vim/commit/0d94ad69586972e7522ec6ca1441a517af2ade7a Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 5 20:16:41 2020 +0200 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.
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 Jul 2020 20:30:06 +0200
parents fab2085e417f
children 7289c8b9a620
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -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'