Problem: Vim9: crash when using varargs type "any".
Solution: Check if uf_va_type is &t_any. (closes #6957)
END
CheckScriptSuccess(lines)
+ lines =<< trim END
+ vim9script
+ def Func(...l: any)
+ echo l
+ enddef
+ Func(0)
+ END
+ CheckScriptSuccess(lines)
+
lines =<< trim END
vim9script
def Func(...l: list<string>)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1695,
/**/
1694,
/**/
continue;
expected = ufunc->uf_arg_types[i];
}
- else if (ufunc->uf_va_type == NULL)
- // possibly a lambda
+ else if (ufunc->uf_va_type == NULL || ufunc->uf_va_type == &t_any)
+ // possibly a lambda or "...: any"
expected = &t_any;
else
expected = ufunc->uf_va_type->tt_member;
// Check the type of the list items.
tv = STACK_TV_BOT(-1);
if (ufunc->uf_va_type != NULL
+ && ufunc->uf_va_type != &t_any
&& ufunc->uf_va_type->tt_member != &t_any
&& tv->vval.v_list != NULL)
{