diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-07-11 14:55:49 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-11 14:55:49 +0200 |
commit | 1aeddeb8bd29a69fa118734c7f27d7df1b37801f (patch) | |
tree | b579bb8065f2e57b074529aacb1cac1e7a7b1d84 /src/evalfunc.c | |
parent | de69a7353e9bec552e15dbe3706a9f4e88080fce (diff) |
patch 8.2.3142: Vim9: type check for has_key() argument is too strictv8.2.3142
Problem: Vim9: type check for has_key() argument is too strict.
Solution: Also allow for a number key argument. (closes #8542)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index 45df08d0c3..73012d45d6 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -446,6 +446,7 @@ argcheck_T arg2_number[] = {arg_number, arg_number}; argcheck_T arg2_string[] = {arg_string, arg_string}; argcheck_T arg2_list_nr[] = {arg_list_number, arg_list_number}; argcheck_T arg2_dict_string[] = {arg_dict_any, arg_string}; +argcheck_T arg2_dict_string_or_nr[] = {arg_dict_any, arg_string_or_nr}; argcheck_T arg2_string_dict[] = {arg_string, arg_dict_any}; argcheck_T arg2_listblob_item[] = {arg_list_or_blob, arg_item_of_prev}; argcheck_T arg2_execute[] = {arg_string_or_list, arg_string}; @@ -1109,7 +1110,7 @@ static funcentry_T global_functions[] = ret_any, f_globpath}, {"has", 1, 2, 0, NULL, ret_number_bool, f_has}, - {"has_key", 2, 2, FEARG_1, arg2_dict_string, + {"has_key", 2, 2, FEARG_1, arg2_dict_string_or_nr, ret_number_bool, f_has_key}, {"haslocaldir", 0, 2, FEARG_1, arg2_number, ret_number, f_haslocaldir}, |