call delete('Xtest2.vim')
endfunc
-func Test_debug_DefFunction()
+func Test_debug_def_and_legacy_function()
CheckCWD
let file =<< trim END
vim9script
call delete('Xtest.vim')
endfunc
+func Test_debug_def_function_with_lambda()
+ CheckCWD
+ let lines =<< trim END
+ vim9script
+ def g:Func()
+ var s = 'a'
+ ['b']->map((_, v) => s)
+ echo "done"
+ enddef
+ breakadd func 2 g:Func
+ END
+ call writefile(lines, 'XtestLambda.vim')
+
+ let buf = RunVimInTerminal('-S XtestLambda.vim', {})
+
+ call RunDbgCmd(buf,
+ \ ':call g:Func()',
+ \ ['function Func', 'line 2: [''b'']->map((_, v) => s)'])
+ call RunDbgCmd(buf,
+ \ 'next',
+ \ ['function Func', 'line 3: echo "done"'])
+
+ call RunDbgCmd(buf, 'cont')
+ call StopVimInTerminal(buf)
+ call delete('XtestLambda.vim')
+endfunc
+
func Test_debug_backtrace_level()
CheckCWD
let lines =<< trim END
// 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.