1
0
forked from aniani/vim

patch 8.2.3997: Vim9: not enough testing for extend() and map()

Problem:    Vim9: not enough testing for extend() and map().
Solution:   Add more test cases.  Fix uncovered problems.  Remove unused type
            fields.
This commit is contained in:
Bram Moolenaar
2022-01-04 15:54:38 +00:00
parent 078a46161e
commit 10d6f18b2f
7 changed files with 39 additions and 15 deletions

View File

@@ -2279,14 +2279,12 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
// ":const var": lock the value, but not referenced variables
generate_LOCKCONST(cctx);
if (is_decl
&& (lhs.lhs_type->tt_type == VAR_DICT
if ((lhs.lhs_type->tt_type == VAR_DICT
|| lhs.lhs_type->tt_type == VAR_LIST)
&& lhs.lhs_type->tt_member != NULL
&& lhs.lhs_type->tt_member != &t_unknown)
// Set the type in the list or dict, so that it can be checked,
// also in legacy script. Not for "list<any> = val", then the
// type of "val" is used.
// also in legacy script.
generate_SETTYPE(cctx, lhs.lhs_type);
if (!skip_store && generate_store_lhs(cctx, &lhs,