diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-08-01 18:53:07 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-08-01 18:53:07 +0200 |
commit | 333894b195479c9304a19f4e6ec1a9c09ecf07e4 (patch) | |
tree | f3d51abe5fcb010185d6b471f1100df09745f0a3 /src/testdir | |
parent | f5a48010ef9e47319185f1aaac1bc6d45cd4d47a (diff) |
patch 8.2.1343: Vim9: cannot find global function when using g:v8.2.1343
Problem: Vim9: cannot find global function when using g: when local
function with the same name exists.
Solution: Find global function when using g:.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_func.vim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 7298d9a734..3acae98ea9 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -161,6 +161,21 @@ def Test_nested_global_function() CheckScriptSuccess(lines) enddef +def Test_global_local_function() + let lines =<< trim END + vim9script + def g:Func(): string + return 'global' + enddef + def Func(): string + return 'local' + enddef + assert_equal('global', g:Func()) + assert_equal('local', Func()) + END + CheckScriptSuccess(lines) +enddef + func TakesOneArg(arg) echo a:arg endfunc |