0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.2580: Vim9: checking vararg type may be wrong

Problem:    Vim9: checking vararg type is wrong when function is auto-loaded.
Solution:   Use the member type. (closes #7933)
This commit is contained in:
Bram Moolenaar
2021-03-08 21:47:13 +01:00
parent d00a7fb81a
commit e3ffcd9902
3 changed files with 13 additions and 2 deletions

View File

@@ -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;