Mercurial > vim
diff src/testdir/test_vim9_func.vim @ 28111:d54541ce3e1b v8.2.4580
patch 8.2.4580: Vim9: incorrect error for shadowing variable
Commit: https://github.com/vim/vim/commit/21dc8f1527fc41405b26a26bb0c318c4b7c1b5d4
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Mar 16 17:54:17 2022 +0000
patch 8.2.4580: Vim9: incorrect error for shadowing variable
Problem: Vim9: incorrect error for shadowing variable.
Solution: Do not pass the context when compiling a referenced function.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 16 Mar 2022 19:00:03 +0100 |
parents | 8a80c48bd103 |
children | e5fcd1256ee3 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -2999,6 +2999,24 @@ def Test_lambda_arg_shadows_func() assert_equal([42], g:Shadowed()) enddef +def Test_compiling_referenced_func_no_shadow() + var lines =<< trim END + vim9script + + def InitializeReply(lspserver: dict<any>) + enddef + + def ProcessReply(lspserver: dict<any>) + var lsp_reply_handlers: dict<func> = + { 'initialize': InitializeReply } + lsp_reply_handlers['initialize'](lspserver) + enddef + + call ProcessReply({}) + END + v9.CheckScriptSuccess(lines) +enddef + def s:Line_continuation_in_def(dir: string = ''): string var path: string = empty(dir) \ ? 'empty'