summaryrefslogtreecommitdiffstats
path: root/src/dict.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-08-30 19:48:24 +0100
committerBram Moolenaar <Bram@vim.org>2022-08-30 19:48:24 +0100
commit04c4c5746e15884768d2cb41370c3276a196cd4c (patch)
tree1e629820796635bd332b2066c03d548fad527f89 /src/dict.c
parentf240395fca63d4b330112a4b81e94b05b50de1aa (diff)
patch 9.0.0335: checks for Dictionary argument often give a vague errorv9.0.0335
Problem: Checks for Dictionary argument often give a vague error message. Solution: Give a useful error message. (Yegappan Lakshmanan, closes #11009)
Diffstat (limited to 'src/dict.c')
-rw-r--r--src/dict.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/dict.c b/src/dict.c
index 58fd68a6f3..874b8231da 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -1578,11 +1578,9 @@ f_has_key(typval_T *argvars, typval_T *rettv)
|| check_for_string_or_number_arg(argvars, 1) == FAIL))
return;
- if (argvars[0].v_type != VAR_DICT)
- {
- emsg(_(e_dictionary_required));
+ if (check_for_dict_arg(argvars, 0) == FAIL)
return;
- }
+
if (argvars[0].vval.v_dict == NULL)
return;