mirror of
https://github.com/vim/vim.git
synced 2025-11-09 10:37:17 -05:00
patch 8.2.0677: Vim9: no support for closures
Problem: Vim9: no support for closures.
Solution: Find variables in the outer function scope, so long as the scope
exists.
This commit is contained in:
@@ -641,4 +641,13 @@ func Test_E1056_1059()
|
||||
call assert_equal(1, caught_1059)
|
||||
endfunc
|
||||
|
||||
def RefFunc(Ref: func(string): string): string
|
||||
return Ref('more')
|
||||
enddef
|
||||
|
||||
def Test_closure_simple()
|
||||
let local = 'some '
|
||||
assert_equal('some more', RefFunc({s -> local .. s}))
|
||||
enddef
|
||||
|
||||
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
|
||||
|
||||
Reference in New Issue
Block a user