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)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 533f5b9..f96a4c4 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -386,11 +386,14 @@
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 @@
{
if (argcount == 1 && argtypes[0]->tt_type == VAR_STRING)
return &t_func_any;
- return &t_func_void;
+ return &t_func_unknown;
}
/*