diff options
-rw-r--r-- | src/testdir/test_vim9_script.vim | 6 | ||||
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim9execute.c | 7 |
3 files changed, 13 insertions, 2 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 2743668ee..32312b0a2 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -3154,6 +3154,10 @@ def Test_vim9_autoload() 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') @@ -3166,6 +3170,8 @@ def Test_vim9_autoload() 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 diff --git a/src/version.c b/src/version.c index 4a4d65a21..f3c79c82f 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2580, +/**/ 2579, /**/ 2578, diff --git a/src/vim9execute.c b/src/vim9execute.c index 2e7e204e3..d4435c4c5 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -807,9 +807,12 @@ call_by_name(char_u *name, int argcount, ectx_T *ectx, isn_T *iptr) // 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; |