diff src/testdir/test_vim9_func.vim @ 21186:34667dc9207b v8.2.1144

patch 8.2.1144: Vim9: return type of reverse() is any Commit: https://github.com/vim/vim/commit/67627355accff4af4f2a7e727c77ea8df675636e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 5 21:10:24 2020 +0200 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.
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 Jul 2020 21:15:04 +0200
parents 2113e94dc726
children 09377fd59b2e
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_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