diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-10-08 14:39:36 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-10-08 14:39:36 +0100 |
commit | 0089ce293f885afc2b77f12aa110f33b2101973a (patch) | |
tree | 2f3bcd5088b4eba7d16466e5d25b3a1699604864 /src/vim9instr.c | |
parent | 4314e4f7da4db5d85f63cdf43b73be3689502c93 (diff) | |
download | vim-git-0089ce293f885afc2b77f12aa110f33b2101973a.tar.gz |
patch 9.0.0695: failing check for dictionary type for const anyv9.0.0695
Problem: Failing check for dictionary type for const any.
Solution: Check for any type properly. (closes #11310)
Diffstat (limited to 'src/vim9instr.c')
-rw-r--r-- | src/vim9instr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vim9instr.c b/src/vim9instr.c index 9c3b2a911..600fab466 100644 --- a/src/vim9instr.c +++ b/src/vim9instr.c @@ -1831,7 +1831,8 @@ generate_STRINGMEMBER(cctx_T *cctx, char_u *name, size_t len) // check for dict type type = get_type_on_stack(cctx, 0); - if (type->tt_type != VAR_DICT && type != &t_any && type != &t_unknown) + if (type->tt_type != VAR_DICT + && type->tt_type != VAR_ANY && type->tt_type != VAR_UNKNOWN) { char *tofree; @@ -1843,7 +1844,7 @@ generate_STRINGMEMBER(cctx_T *cctx, char_u *name, size_t len) // change dict type to dict member type if (type->tt_type == VAR_DICT) { - type_T *ntype = type->tt_member == &t_unknown + type_T *ntype = type->tt_member->tt_type == VAR_UNKNOWN ? &t_any : type->tt_member; set_type_on_stack(cctx, ntype, 0); } |