diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-27 16:36:29 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-27 16:36:29 +0000 |
commit | 35c807df1f5774f09612d756ddc3cd5c44eacaca (patch) | |
tree | 5f591a6dd01925947e2e3c6e9c6e5a5ae8c3dc77 /src/vim9instr.c | |
parent | 94373c48e7e438e5b924b34ce820e9b2eb9f810c (diff) | |
download | vim-git-35c807df1f5774f09612d756ddc3cd5c44eacaca.tar.gz |
patch 8.2.4231: Vim9: map() gives type error when type was not declaredv8.2.4231
Problem: Vim9: map() gives type error when type was not declared.
Solution: Only check the type when it was declared, like extend() does.
(closes #9635)
Diffstat (limited to 'src/vim9instr.c')
-rw-r--r-- | src/vim9instr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vim9instr.c b/src/vim9instr.c index d000c4acd..e869d9ea6 100644 --- a/src/vim9instr.c +++ b/src/vim9instr.c @@ -1331,10 +1331,10 @@ generate_BCALL(cctx_T *cctx, int func_idx, int argcount, int method_call) if (push_type_stack(cctx, type) == FAIL) return FAIL; - if (maptype != NULL && maptype[0].type_curr->tt_member != NULL - && maptype[0].type_curr->tt_member != &t_any) + if (maptype != NULL && maptype[0].type_decl->tt_member != NULL + && maptype[0].type_decl->tt_member != &t_any) // Check that map() didn't change the item types. - generate_TYPECHECK(cctx, maptype[0].type_curr, -1, 1); + generate_TYPECHECK(cctx, maptype[0].type_decl, -1, 1); return OK; } |