diff src/testdir/test_vim9_func.vim @ 21184:2113e94dc726 v8.2.1143

patch 8.2.1143: Vim9: return type of remove() is any Commit: https://github.com/vim/vim/commit/ad7c24932725b9ab37b65fe359a41f8ba3e3dfcf Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 5 20:55:29 2020 +0200 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.
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 Jul 2020 21:00:05 +0200
parents 7289c8b9a620
children 34667dc9207b
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -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