Problem: Vim9: incorrect error for shadowing variable.
Solution: Do not pass the context when compiling a referenced function.
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'
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4580,
/**/
4579,
/**/
// Need to compile any default values to get the argument types.
compile_type = get_compile_type(ufunc);
if (func_needs_compiling(ufunc, compile_type)
- && compile_def_function(ufunc, TRUE, compile_type, cctx) == FAIL)
+ && compile_def_function(ufunc, TRUE, compile_type, NULL) == FAIL)
return FAIL;
return generate_PUSHFUNC(cctx, ufunc->uf_name, ufunc->uf_func_type);
}