forked from aniani/vim
patch 8.2.3705: cannot pass a lambda name to function() or funcref()
Problem: Cannot pass a lambda name to function() or funcref(). (Yegappan Lakshmanan) Solution: Handle a lambda name differently.
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user