diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-11-30 18:25:08 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-11-30 18:25:08 +0000 |
commit | eba3b7f6645c8f856132b4c06a009a3b0a44e21c (patch) | |
tree | 020a6f90c5d1d78881e237b5339e63a59b266769 /src/testdir/test_expr.vim | |
parent | ab36e6ae7b87b0295fb19270e4339a734875c6b1 (diff) |
patch 8.2.3705: cannot pass a lambda name to function() or funcref()v8.2.3705
Problem: Cannot pass a lambda name to function() or funcref(). (Yegappan
Lakshmanan)
Solution: Handle a lambda name differently.
Diffstat (limited to 'src/testdir/test_expr.vim')
-rw-r--r-- | src/testdir/test_expr.vim | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim index 323ce2626d..46d7186125 100644 --- a/src/testdir/test_expr.vim +++ b/src/testdir/test_expr.vim @@ -547,6 +547,13 @@ func Test_function_with_funcref() call assert_fails("call function('foo()')", 'E475:') call assert_fails("call function('foo()')", 'foo()') call assert_fails("function('')", 'E129:') + + let Len = {s -> strlen(s)} + call assert_equal(6, Len('foobar')) + let name = string(Len) + " can evaluate "function('<lambda>99')" + call execute('let Ref = ' .. name) + call assert_equal(4, Ref('text')) endfunc func Test_funcref() |