Mercurial > vim
diff src/vim9compile.c @ 26937:7045e9308ca3 v8.2.3997
patch 8.2.3997: Vim9: not enough testing for extend() and map()
Commit: https://github.com/vim/vim/commit/10d6f18b2f9090d19dd884827c4be59a20b446bf
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 4 15:54:38 2022 +0000
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 04 Jan 2022 17:00:04 +0100 |
parents | ccb9be1cdd71 |
children | 043a15b37bf1 |
line wrap: on
line diff
--- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -2279,14 +2279,12 @@ compile_assignment(char_u *arg, exarg_T // ":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,