0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.0760: Vim9: dict member errors not tested

Problem:    Vim9: dict member errors not tested.
Solution:   Delete unreachable error.  Add tests.
This commit is contained in:
Bram Moolenaar
2020-05-15 21:44:19 +02:00
parent 270d0388d2
commit 4dac32caf3
3 changed files with 9 additions and 10 deletions

View File

@@ -2104,20 +2104,13 @@ call_def_function(
// dict member: dict is at stack-2, key at stack-1
tv = STACK_TV_BOT(-2);
if (tv->v_type != VAR_DICT)
{
emsg(_(e_dictreq));
goto failed;
}
// no need to check for VAR_DICT, CHECKTYPE will check.
dict = tv->vval.v_dict;
tv = STACK_TV_BOT(-1);
if (tv->v_type != VAR_STRING)
{
emsg(_(e_stringreq));
goto failed;
}
// no need to check for VAR_STRING, 2STRING will check.
key = tv->vval.v_string;
if ((di = dict_find(dict, key, -1)) == NULL)
{
semsg(_(e_dictkey), key);