diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-04-07 21:21:13 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-04-07 21:21:13 +0200 |
commit | 15e5e53ef29a457126f7c699931ab5842431f2ea (patch) | |
tree | 53630cc1e055063999dd34c68d8c77fbd03105ea /src/testdir/test_vim9_expr.vim | |
parent | 130cbfc31235c6cb52ffe718ea0a5bb50fbbc9fd (diff) |
patch 8.2.2734: Vim9: cannot use legacy script-local var from :def functionv8.2.2734
Problem: Vim9: cannot use legacy script-local var from :def function.
Solution: Do not insist on using "s:" prefix. (closes #8076)
Diffstat (limited to 'src/testdir/test_vim9_expr.vim')
-rw-r--r-- | src/testdir/test_vim9_expr.vim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim index 4e1e3d7fae..c86379eb1a 100644 --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -2714,6 +2714,21 @@ def Test_expr7_negate_add() CheckDefAndScriptFailure(lines, 'E1050:') enddef +def Test_expr7_legacy_script() + var lines =<< trim END + let s:legacy = 'legacy' + def GetLocal(): string + return legacy + enddef + def GetLocalPrefix(): string + return s:legacy + enddef + call assert_equal('legacy', GetLocal()) + call assert_equal('legacy', GetLocalPrefix()) + END + CheckScriptSuccess(lines) +enddef + def Echo(arg: any): string return arg enddef |