1
0
forked from aniani/vim

patch 8.2.3948: Vim9: failure with partial with unknown argument count

Problem:    Vim9: failure with partial with unknown argument count.
Solution:   Do not copy argument types if there aren't any.
This commit is contained in:
Bram Moolenaar
2021-12-30 13:59:20 +00:00
parent f38aad85cf
commit cfe3af284a
2 changed files with 14 additions and 9 deletions

View File

@@ -749,6 +749,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
3948,
/**/ /**/
3947, 3947,
/**/ /**/

View File

@@ -369,6 +369,8 @@ typval2type_int(typval_T *tv, int copyID, garray_T *type_gap, int do_member)
if (type == NULL) if (type == NULL)
return NULL; return NULL;
*type = *ufunc->uf_func_type; *type = *ufunc->uf_func_type;
if (type->tt_argcount >= 0)
{
type->tt_argcount -= tv->vval.v_partial->pt_argc; type->tt_argcount -= tv->vval.v_partial->pt_argc;
type->tt_min_argcount -= tv->vval.v_partial->pt_argc; type->tt_min_argcount -= tv->vval.v_partial->pt_argc;
if (type->tt_argcount == 0) if (type->tt_argcount == 0)
@@ -383,6 +385,7 @@ typval2type_int(typval_T *tv, int copyID, garray_T *type_gap, int do_member)
type->tt_args[i] = ufunc->uf_func_type->tt_args[ type->tt_args[i] = ufunc->uf_func_type->tt_args[
i + tv->vval.v_partial->pt_argc]; i + tv->vval.v_partial->pt_argc];
} }
}
return type; return type;
} }
return ufunc->uf_func_type; return ufunc->uf_func_type;