patch 9.0.0335: checks for Dictionary argument often give a vague error
Problem: Checks for Dictionary argument often give a vague error message.
Solution: Give a useful error message. (Yegappan Lakshmanan, closes #11009)
diff --git a/src/list.c b/src/list.c
index a6805ed..7bc34db 100644
--- a/src/list.c
+++ b/src/list.c
@@ -2236,11 +2236,8 @@
if (argvars[2].v_type != VAR_UNKNOWN)
{
// optional third argument: {dict}
- if (argvars[2].v_type != VAR_DICT)
- {
- emsg(_(e_dictionary_required));
+ if (check_for_dict_arg(argvars, 2) == FAIL)
return FAIL;
- }
info->item_compare_selfdict = argvars[2].vval.v_dict;
}