summaryrefslogtreecommitdiffstats
path: root/src/evalfunc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-16 15:22:00 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-16 15:22:00 +0200
commit5e654230777ad21363a929dce3cfe0387da031a7 (patch)
tree967aea5363b039cb47c98bf2ef2e992f182b29da /src/evalfunc.c
parent8b51b7f0f17af149a8ce76e805050977857f9e50 (diff)
patch 8.2.1691: Vim9: list<any> is not accepted where list<number> is expectedv8.2.1691
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)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r--src/evalfunc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 533f5b95dd..f96a4c44d1 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -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;
}
/*