1
0
forked from aniani/vim

patch 8.2.3269: Vim9: wrong argument check for partial

Problem:    Vim9: wrong argument check for partial. (Naohiro Ono)
Solution:   Handle getting return type without arguments. Correct the minimal
            number of arguments for what is included in the partial.
            (closes #8667)
This commit is contained in:
Bram Moolenaar
2021-08-01 15:40:31 +02:00
parent 73b8b0ae3a
commit f78da4f9d6
4 changed files with 44 additions and 24 deletions

View File

@@ -378,6 +378,11 @@ typval2type_int(typval_T *tv, int copyID, garray_T *type_gap, int do_member)
type->tt_type = tv->v_type;
type->tt_argcount = argcount;
type->tt_min_argcount = min_argcount;
if (tv->v_type == VAR_PARTIAL && tv->vval.v_partial->pt_argc > 0)
{
type->tt_argcount -= tv->vval.v_partial->pt_argc;
type->tt_min_argcount -= tv->vval.v_partial->pt_argc;
}
type->tt_member = member_type;
return type;