0
0
mirror of https://github.com/vim/vim.git synced 2025-10-14 07:04:10 -04:00

patch 8.2.1256: Vim9: type wrong after getting dict item in lambda

Problem:    Vim9: type wrong after getting dict item in lambda.
Solution:   Set the type to "any" after enforcing dict type. (closes #6491)
This commit is contained in:
Bram Moolenaar
2020-07-20 22:09:34 +02:00
parent d43906d2e5
commit 7892b953e0
3 changed files with 12 additions and 3 deletions

View File

@@ -3797,9 +3797,12 @@ compile_subscript(
{
if ((*typep)->tt_type == VAR_DICT)
*typep = (*typep)->tt_member;
else if (need_type(*typep, &t_dict_any, -2, cctx, FALSE)
== FAIL)
return FAIL;
else
{
if (need_type(*typep, &t_dict_any, -2, cctx, FALSE) == FAIL)
return FAIL;
*typep = &t_any;
}
if (may_generate_2STRING(-1, cctx) == FAIL)
return FAIL;
if (generate_instr_drop(cctx, ISN_MEMBER, 1) == FAIL)