diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-02-06 15:49:35 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-02-06 15:49:35 +0000 |
commit | 2626d6a71ca616bd91d4ee2c27bd76a78a00d412 (patch) | |
tree | c95b2cbe59caeb449cd551f22e286f906d69a905 /src/vim9instr.c | |
parent | fe1bfc9b267fffedac6b5224d7aa6cc5d9d15f64 (diff) | |
download | vim-git-2626d6a71ca616bd91d4ee2c27bd76a78a00d412.tar.gz |
patch 8.2.4310: Vim9: constant list and dict get a declaration typev8.2.4310
Problem: Vim9: constant list and dict get a declaration type other than
"any".
Solution: A constant list and dict have a declared member type "any".
(closes #9701)
Diffstat (limited to 'src/vim9instr.c')
-rw-r--r-- | src/vim9instr.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/vim9instr.c b/src/vim9instr.c index 60963a3c9..cf26650d1 100644 --- a/src/vim9instr.c +++ b/src/vim9instr.c @@ -1067,7 +1067,6 @@ generate_NEWLIST(cctx_T *cctx, int count) { isn_T *isn; type_T *member_type; - type_T *decl_member_type; type_T *type; type_T *decl_type; @@ -1078,10 +1077,9 @@ generate_NEWLIST(cctx_T *cctx, int count) // Get the member type and the declared member type from all the items on // the stack. - member_type = get_member_type_from_stack(count, 1, - &decl_member_type, cctx); + member_type = get_member_type_from_stack(count, 1, cctx); type = get_list_type(member_type, cctx->ctx_type_list); - decl_type = get_list_type(decl_member_type, cctx->ctx_type_list); + decl_type = get_list_type(&t_any, cctx->ctx_type_list); // drop the value types cctx->ctx_type_stack.ga_len -= count; @@ -1098,7 +1096,6 @@ generate_NEWDICT(cctx_T *cctx, int count) { isn_T *isn; type_T *member_type; - type_T *decl_member_type; type_T *type; type_T *decl_type; @@ -1107,10 +1104,9 @@ generate_NEWDICT(cctx_T *cctx, int count) return FAIL; isn->isn_arg.number = count; - member_type = get_member_type_from_stack(count, 2, - &decl_member_type, cctx); + member_type = get_member_type_from_stack(count, 2, cctx); type = get_dict_type(member_type, cctx->ctx_type_list); - decl_type = get_dict_type(decl_member_type, cctx->ctx_type_list); + decl_type = get_dict_type(&t_any, cctx->ctx_type_list); // drop the key and value types cctx->ctx_type_stack.ga_len -= 2 * count; |