diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-03-04 12:38:21 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-03-04 12:38:21 +0100 |
commit | 6c3843ca8ab105bfb85f6ea8bcec2cbc03f46e7f (patch) | |
tree | 8a465281d263c75273b02673e15ecec42e797bdd /src/testdir/test_vim9_script.vim | |
parent | 2e2d758902dc08a0e383fe6b198e11dd14f1bdf8 (diff) | |
download | vim-git-6c3843ca8ab105bfb85f6ea8bcec2cbc03f46e7f.tar.gz |
patch 8.2.2567: Vim9: no error if variable is defined for existing functionv8.2.2567
Problem: Vim9: no error if variable is defined for existing function.
Solution: Check if name isn't already in use. (closes #7897)
Diffstat (limited to 'src/testdir/test_vim9_script.vim')
-rw-r--r-- | src/testdir/test_vim9_script.vim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 5d1e4015a..2743668ee 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -1515,6 +1515,17 @@ def Test_script_reload_change_type() delete('Xreload.vim') enddef +def Test_script_var_shadows_function() + var lines =<< trim END + vim9script + def Func(): number + return 123 + enddef + var Func = 1 + END + CheckScriptFailure(lines, 'E1041:', 5) +enddef + def s:RetSome(): string return 'some' enddef |