diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-02-13 13:56:29 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-02-13 13:56:29 +0000 |
commit | 75e27d78f5370e7d2e0898326d9b080937e7b090 (patch) | |
tree | 410ddc3fcf6d8ebd84883143ef78d8923e75233b /src/testdir/test_vim9_script.vim | |
parent | cf6ad8ea8cff318877758b48d3786ab08251ab89 (diff) |
patch 8.2.4371: Vim9: can create a script variable from a legacy functionv8.2.4371
Problem: Vim9: can create a script variable from a legacy function.
Solution: Disallow creating a script variable from a function.
Diffstat (limited to 'src/testdir/test_vim9_script.vim')
-rw-r--r-- | src/testdir/test_vim9_script.vim | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index eec19d94fb..9993c5edb3 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -3071,13 +3071,21 @@ def Test_forward_declaration() delete('Xforward') enddef -def Test_declare_script_in_func() +def Test_declare_script_var_in_func() var lines =<< trim END vim9script func Declare() let s:local = 123 endfunc Declare() + END + v9.CheckScriptFailure(lines, 'E1269:') +enddef + +def Test_lock_script_var() + var lines =<< trim END + vim9script + var local = 123 assert_equal(123, local) var error: string |