File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -739,6 +739,19 @@ def Test_lambda_uses_assigned_var()
739739 ' x = filter(["bbb"], (_, v) => v =~ x)' ])
740740enddef
741741
742+ def Test_pass_legacy_lambda_to_def_func ()
743+ var lines = << trim END
744+ vim9script
745+ func Foo ()
746+ eval s: Bar ({x - > 0 })
747+ endfunc
748+ def Bar (y : any)
749+ enddef
750+ Foo ()
751+ END
752+ CheckScriptSuccess (lines )
753+ enddef
754+
742755" Default arg and varargs
743756def MyDefVarargs (one: string , two = ' foo' , ... rest: list <string> ): string
744757 var res = one .. ' ,' .. two
Original file line number Diff line number Diff line change @@ -750,6 +750,8 @@ static char *(features[]) =
750750
751751static int included_patches [] =
752752{ /* Add new patch number below this line */
753+ /**/
754+ 2572 ,
753755/**/
754756 2571 ,
755757/**/
Original file line number Diff line number Diff line change @@ -274,7 +274,7 @@ arg_exists(
274274 * Lookup a script-local variable in the current script, possibly defined in a
275275 * block that contains the function "cctx->ctx_ufunc".
276276 * "cctx" is NULL at the script level.
277- * if "len" is <= 0 "name" must be NUL terminated.
277+ * If "len" is <= 0 "name" must be NUL terminated.
278278 * Return NULL when not found.
279279 */
280280 static sallvar_T *
@@ -8730,6 +8730,8 @@ set_function_type(ufunc_T *ufunc)
87308730 // The type is included in "tt_args".
87318731 if (argcount > 0 || varargs )
87328732 {
8733+ if (ufunc -> uf_type_list .ga_itemsize == 0 )
8734+ ga_init2 (& ufunc -> uf_type_list , sizeof (type_T * ), 10 );
87338735 ufunc -> uf_func_type = alloc_func_type (ufunc -> uf_ret_type ,
87348736 argcount , & ufunc -> uf_type_list );
87358737 // Add argument types to the function type.
You can’t perform that action at this time.
0 commit comments