1
0
forked from aniani/vim

patch 8.2.4927: return type of remove() incorrect when using three arguments

Problem:    Return type of remove() incorrect when using three arguments.
Solution:   Use first argument type when there are three arguments.
            (closes #10387)
This commit is contained in:
Bram Moolenaar
2022-05-09 14:12:14 +01:00
parent 51f0bc31d3
commit 2ac037f54b
3 changed files with 13 additions and 7 deletions

View File

@@ -1420,13 +1420,18 @@ ret_argv(int argcount,
static type_T *
ret_remove(int argcount,
type2_T *argtypes,
type_T **decl_type UNUSED)
type_T **decl_type)
{
if (argcount > 0)
{
if (argtypes[0].type_curr->tt_type == VAR_LIST
|| argtypes[0].type_curr->tt_type == VAR_DICT)
{
if (argcount == 3)
{
*decl_type = argtypes[0].type_decl;
return argtypes[0].type_curr;
}
if (argtypes[0].type_curr->tt_type
== argtypes[0].type_decl->tt_type)
*decl_type = argtypes[0].type_decl->tt_member;