diff src/testdir/test_vim9_func.vim @ 21182:7289c8b9a620 v8.2.1142

patch 8.2.1142: Vim9: return type of insert() is any Commit: https://github.com/vim/vim/commit/252e88a78535d239ec4b764d8e3f04aad5a94a76 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 5 20:47:18 2020 +0200 patch 8.2.1142: Vim9: return type of insert() is any Problem: Vim9: return type of insert() is any. Solution: Use type of the first argument.
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 Jul 2020 21:00:04 +0200
parents dde4c2e84f5c
children 2113e94dc726
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_insert_return_type()
+  let l = insert([2, 1], 3)
+  let res = 0
+  for n in l
+    res += n
+  endfor
+  assert_equal(6, res)
+enddef
+
 def Test_filter_return_type()
   let l = filter([1, 2, 3], {-> 1})
   let res = 0