patch 8.2.2740: Vim9: lambda with varargs doesn't work
Problem: Vim9: lambda with varargs doesn't work.
Solution: Make "...name" work. Require type to be a list.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 00a8f56..2cfc127 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1856,7 +1856,8 @@
continue;
expected = ufunc->uf_arg_types[i];
}
- else if (ufunc->uf_va_type == NULL || ufunc->uf_va_type == &t_any)
+ else if (ufunc->uf_va_type == NULL
+ || ufunc->uf_va_type == &t_list_any)
// possibly a lambda or "...: any"
expected = &t_any;
else
@@ -9069,7 +9070,7 @@
if (varargs)
{
ufunc->uf_func_type->tt_args[argcount] =
- ufunc->uf_va_type == NULL ? &t_any : ufunc->uf_va_type;
+ ufunc->uf_va_type == NULL ? &t_list_any : ufunc->uf_va_type;
ufunc->uf_func_type->tt_flags = TTFLAG_VARARGS;
}
}