Problem: Vim9: no runtime check for argument type if a function only has
varargs.
Solution: Also check argument types if uf_va_type is set. (closes #8715)
enddef
END
CheckScriptFailure(lines, 'E1160:')
+
+ lines =<< trim END
+ vim9script
+ def DoIt()
+ g:Later('')
+ enddef
+ defcompile
+ def g:Later(...l: list<number>)
+ enddef
+ DoIt()
+ END
+ CheckScriptFailure(lines, 'E1013: Argument 1: type mismatch, expected number but got string')
enddef
let s:value = ''
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3308,
/**/
3307,
/**/
if (ufunc != NULL)
{
- if (ufunc->uf_arg_types != NULL)
+ if (ufunc->uf_arg_types != NULL || ufunc->uf_va_type != NULL)
{
int i;
typval_T *argv = STACK_TV_BOT(0) - argcount;
{
type_T *type = NULL;
- if (i < ufunc->uf_args.ga_len)
+ if (i < ufunc->uf_args.ga_len && ufunc->uf_arg_types != NULL)
type = ufunc->uf_arg_types[i];
else if (ufunc->uf_va_type != NULL)
type = ufunc->uf_va_type->tt_member;