1
0
forked from aniani/vim

patch 8.2.3066: Vim9: debugging lambda does not work

Problem:    Vim9: debugging lambda does not work.
Solution:   Use the compile type of the function when compiling a lambda.
            (closes #8412)
This commit is contained in:
Bram Moolenaar
2021-06-27 16:29:53 +02:00
parent 577dc93da9
commit 17d868b8b2
3 changed files with 31 additions and 2 deletions

View File

@@ -3622,7 +3622,7 @@ compile_lambda(char_u **arg, cctx_T *cctx)
// compile_return().
if (ufunc->uf_ret_type->tt_type == VAR_VOID)
ufunc->uf_ret_type = &t_unknown;
compile_def_function(ufunc, FALSE, COMPILE_TYPE(ufunc), cctx);
compile_def_function(ufunc, FALSE, cctx->ctx_compile_type, cctx);
// evalarg.eval_tofree_cmdline may have a copy of the last line and "*arg"
// points into it. Point to the original line to avoid a dangling pointer.