0
0
mirror of https://github.com/vim/vim.git synced 2025-10-13 06:54:15 -04:00

patch 8.2.1691: Vim9: list<any> is not accepted where list<number> is expected

Problem:    Vim9: list<any> is not accepted where list<number> is expected.
Solution:   Add functions to allocate and free a type_T, use it in
            ISN_CHECKTYPE. (closes #6959)
This commit is contained in:
Bram Moolenaar
2020-09-16 15:22:00 +02:00
parent 8b51b7f0f1
commit 5e65423077
13 changed files with 253 additions and 149 deletions

View File

@@ -386,11 +386,14 @@ ret_argv(int argcount, type_T **argtypes UNUSED)
static type_T *
ret_remove(int argcount UNUSED, type_T **argtypes)
{
if (argtypes[0]->tt_type == VAR_LIST
|| argtypes[0]->tt_type == VAR_DICT)
return argtypes[0]->tt_member;
if (argtypes[0]->tt_type == VAR_BLOB)
return &t_number;
if (argtypes != NULL)
{
if (argtypes[0]->tt_type == VAR_LIST
|| argtypes[0]->tt_type == VAR_DICT)
return argtypes[0]->tt_member;
if (argtypes[0]->tt_type == VAR_BLOB)
return &t_number;
}
return &t_any;
}
@@ -2915,7 +2918,7 @@ ret_f_function(int argcount, type_T **argtypes)
{
if (argcount == 1 && argtypes[0]->tt_type == VAR_STRING)
return &t_func_any;
return &t_func_void;
return &t_func_unknown;
}
/*