0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.4313: Vim9: cannot change type of list after making a slice

Problem:    Vim9: cannot change type of list after making a slice.
Solution:   Adjust the declared member type. (closes #9696)
This commit is contained in:
Bram Moolenaar
2022-02-06 18:36:53 +00:00
parent 107f7325f6
commit 5f4ef5f5e5
3 changed files with 6 additions and 0 deletions

View File

@@ -182,6 +182,9 @@ compile_member(int is_slice, int *keeping_dict, cctx_T *cctx)
vartype == VAR_LIST ? ISN_LISTSLICE : ISN_ANYSLICE,
2) == FAIL)
return FAIL;
// a copy is made so the member type is no longer declared
if (typep->type_decl->tt_type == VAR_LIST)
typep->type_decl = &t_list_any;
}
else
{