diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-25 21:32:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-25 21:32:12 +0800 |
commit | 43c49746d9cf82dba0d56b07d39722f9ebeecf90 (patch) | |
tree | 3d7f3aeb8522e11b55fc5ac296c9c13d370933e1 /src/nvim/eval.c | |
parent | 2e8410b7be9dce7e5fa12a442e19d548bfb260bc (diff) | |
download | rneovim-43c49746d9cf82dba0d56b07d39722f9ebeecf90.tar.gz rneovim-43c49746d9cf82dba0d56b07d39722f9ebeecf90.tar.bz2 rneovim-43c49746d9cf82dba0d56b07d39722f9ebeecf90.zip |
vim-patch:9.0.0335: checks for Dictionary argument often give a vague error (#23309)
Problem: Checks for Dictionary argument often give a vague error message.
Solution: Give a useful error message. (Yegappan Lakshmanan, closes vim/vim#11009)
https://github.com/vim/vim/commit/04c4c5746e15884768d2cb41370c3276a196cd4c
Cherry-pick removal of E922 from docs from patch 9.0.1403.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 35738cdfa9..bc33697c62 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -5357,8 +5357,7 @@ void common_function(typval_T *argvars, typval_T *rettv, bool is_funcref) arg_idx = 1; } if (dict_idx > 0) { - if (argvars[dict_idx].v_type != VAR_DICT) { - emsg(_("E922: expected a dict")); + if (tv_check_for_dict_arg(argvars, dict_idx) == FAIL) { xfree(name); goto theend; } @@ -8726,7 +8725,7 @@ int typval_compare(typval_T *typ1, typval_T *typ2, exprtype_T type, bool ic) const bool type_is = type == EXPR_IS || type == EXPR_ISNOT; if (type_is && typ1->v_type != typ2->v_type) { - // For "is" a different type always means false, for "notis" + // For "is" a different type always means false, for "isnot" // it means true. n1 = type == EXPR_ISNOT; } else if (typ1->v_type == VAR_BLOB || typ2->v_type == VAR_BLOB) { |