enddef
END
CheckDefFailure(lines, 'E1167:')
+
+ lines =<< trim END
+ echo ((a) => a)('aa', 'bb')
+ END
+ CheckDefAndScriptFailure(lines, 'E118:', 1)
enddef
def FilterWithCond(x: string, Cond: func(string): bool): bool
->substitute("('", ' ', '')
->substitute("')", '', '')
->substitute('function\zs', ' ', ''))
- assert_match('def <lambda>\d\+(_: any, ...): number\n1 return 0\n enddef', body)
+ assert_match('def <lambda>\d\+(_: any): number\n1 return 0\n enddef', body)
enddef
def DoFilterThis(a: string): list<string>
vim9script
au BufWinLeave * #
def Func()
- popup_menu('', {callback: () => popup_create('', {})->popup_close()})
+ popup_menu('', {callback: (a, b) => popup_create('', {})->popup_close()})
eval [][0]
enddef
nno <F3> <cmd>call <sid>Func()<cr>
vim9script
set cpo+=M
exe 'set rtp^=' .. getcwd() .. '/Xdir'
- au CmdlineEnter : ++once timer_start(0, () => script#func())
+ au CmdlineEnter : ++once timer_start(0, (_) => script#func())
setline(1, 'some text')
END
call writefile(lines, 'XTest_redraw_cpo')
#endif
if (sandbox)
flags |= FC_SANDBOX;
- // can be called with more args than uf_args.ga_len
- fp->uf_varargs = TRUE;
+ // In legacy script a lambda can be called with more args than
+ // uf_args.ga_len.
+ fp->uf_varargs = !in_vim9script();
fp->uf_flags = flags;
fp->uf_calls = 0;
fp->uf_script_ctx = current_sctx;