0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.1527: Vim9: cannot use a function name at script level

Problem:    Vim9: cannot use a function name as a function reference at script
            level.
Solution:   Check if a name is a function name. (closes #6789)
This commit is contained in:
Bram Moolenaar
2020-08-27 21:33:10 +02:00
parent 228e62975e
commit 601e76ac3c
4 changed files with 39 additions and 7 deletions

View File

@@ -1668,6 +1668,17 @@ def Test_expr7_lambda_vim9script()
CheckScriptSuccess(lines)
enddef
def Test_epxr7_funcref()
let lines =<< trim END
def RetNumber(): number
return 123
enddef
let FuncRef = RetNumber
assert_equal(123, FuncRef())
END
CheckDefAndScriptSuccess(lines)
enddef
def Test_expr7_dict()
# dictionary
assert_equal(g:dict_empty, {})