diff src/testdir/test_vim9_func.vim @ 20433:5950284a517f v8.2.0771

patch 8.2.0771: Vim9: cannot call a compiled closure from not compiled code Commit: https://github.com/vim/vim/commit/6f5b6dfb16228c0ce1e4379b7bafed02eaddbab2 Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 16 21:20:12 2020 +0200 patch 8.2.0771: Vim9: cannot call a compiled closure from not compiled code Problem: Vim9: cannot call a compiled closure from not compiled code. Solution: Pass funcexe to call_user_func().
author Bram Moolenaar <Bram@vim.org>
date Sat, 16 May 2020 21:30:10 +0200
parents fc2d76e0994c
children 489cb75c76b6
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -792,5 +792,15 @@ def Test_nested_closure()
   assert_equal('text!!!', Closure('!!!'))
 enddef
 
+func GetResult(Ref)
+  return a:Ref('some')
+endfunc
+
+def Test_call_closure_not_compiled()
+  let text = 'text'
+  g:Ref = {s ->  s .. text}
+  assert_equal('sometext', GetResult(g:Ref))
+enddef
+
 
 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker