Mercurial > vim
diff src/evalfunc.c @ 22284:6b385c2b9ff5 v8.2.1691
patch 8.2.1691: Vim9: list<any> is not accepted where list<number> is expected
Commit: https://github.com/vim/vim/commit/5e654230777ad21363a929dce3cfe0387da031a7
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 16 15:22:00 2020 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 16 Sep 2020 15:30:07 +0200 |
parents | f22acf6472da |
children | 0491b9cafd44 |
line wrap: on
line diff
--- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -386,11 +386,14 @@ ret_argv(int argcount, type_T **argtypes 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 **ar { if (argcount == 1 && argtypes[0]->tt_type == VAR_STRING) return &t_func_any; - return &t_func_void; + return &t_func_unknown; } /*