comparison src/testdir/test_vim9_func.vim @ 21604:d9c45474cac1 v8.2.1352

patch 8.2.1352: Vim9: no error for shadowing a script-local function Commit: https://github.com/vim/vim/commit/ad486a0f0dd194826fdb733516bf0f35382c9dd7 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 1 23:22:18 2020 +0200 patch 8.2.1352: Vim9: no error for shadowing a script-local function Problem: Vim9: no error for shadowing a script-local function by a nested function. Solution: Check for script-local function. (closes #6586)
author Bram Moolenaar <Bram@vim.org>
date Sat, 01 Aug 2020 23:30:03 +0200
parents 7028f45bf0ea
children 3c6c52fbc8ea
comparison
equal deleted inserted replaced
21603:c6c1c4a5e4e0 21604:d9c45474cac1
172 defcompile 172 defcompile
173 Outer() 173 Outer()
174 Outer() 174 Outer()
175 END 175 END
176 CheckScriptFailure(lines, "E122:") 176 CheckScriptFailure(lines, "E122:")
177
178 lines =<< trim END
179 vim9script
180 def Func()
181 echo 'script'
182 enddef
183 def Outer()
184 def Func()
185 echo 'inner'
186 enddef
187 enddef
188 defcompile
189 END
190 CheckScriptFailure(lines, "E1073:")
177 enddef 191 enddef
178 192
179 def Test_global_local_function() 193 def Test_global_local_function()
180 let lines =<< trim END 194 let lines =<< trim END
181 vim9script 195 vim9script