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

patch 8.2.4231: Vim9: map() gives type error when type was not declared

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)
This commit is contained in:
Bram Moolenaar
2022-01-27 16:36:29 +00:00
parent 94373c48e7
commit 35c807df1f
6 changed files with 35 additions and 20 deletions

View File

@@ -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;
}