Problem: Vim9: checking vararg type is wrong when function is auto-loaded.
Solution: Use the member type. (closes #7933)
return 'test'
enddef
g:some#name = 'name'
+
+ def some#varargs(a1: string, ...l: list<string>): string
+ return a1 .. l[0] .. l[1]
+ enddef
END
mkdir('Xdir/autoload', 'p')
g:some#other = 'other'
assert_equal('other', g:some#other)
+ assert_equal('abc', some#varargs('a', 'b', 'c'))
+
# upper case script name works
lines =<< trim END
vim9script
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2580,
/**/
2579,
/**/
// types are correct.
for (i = 0; i < argcount; ++i)
{
- type_T *type = i < ufunc->uf_args.ga_len
- ? ufunc->uf_arg_types[i] : ufunc->uf_va_type;
+ type_T *type = NULL;
+ if (i < ufunc->uf_args.ga_len)
+ type = ufunc->uf_arg_types[i];
+ else if (ufunc->uf_va_type != NULL)
+ type = ufunc->uf_va_type->tt_member;
if (type != NULL && check_typval_arg_type(type,
&argv[i], i + 1) == FAIL)
return FAIL;