Mercurial > vim
diff src/testdir/test_vim9_expr.vim @ 24390:492f7b54f691 v8.2.2735
patch 8.2.2735: Vim9: function reference found with prefix, not without
Commit: https://github.com/vim/vim/commit/fa5963880df1d11613594ab78c0a68f894d34aa3
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Apr 7 21:58:16 2021 +0200
patch 8.2.2735: Vim9: function reference found with prefix, not without
Problem: Vim9: function reference found with prefix, not without.
Solution: Also find function reference without prefix.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 07 Apr 2021 22:00:04 +0200 |
parents | 72f3e40f046c |
children | fe71212fd202 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -2102,6 +2102,29 @@ def Test_expr7_funcref() assert_equal(123, FuncRef()) END CheckDefAndScriptSuccess(lines) + + lines =<< trim END + vim9script + func g:GlobalFunc() + return 'global' + endfunc + func s:ScriptFunc() + return 'script' + endfunc + def Test() + var Ref = g:GlobalFunc + assert_equal('global', Ref()) + Ref = GlobalFunc + assert_equal('global', Ref()) + + Ref = s:ScriptFunc + assert_equal('script', Ref()) + Ref = ScriptFunc + assert_equal('script', Ref()) + enddef + Test() + END + CheckScriptSuccess(lines) enddef let g:test_space_dict = {'': 'empty', ' ': 'space'}