Mercurial > vim
comparison src/vim9instr.c @ 27406:4c1bdee75bed v8.2.4231
patch 8.2.4231: Vim9: map() gives type error when type was not declared
Commit: https://github.com/vim/vim/commit/35c807df1f5774f09612d756ddc3cd5c44eacaca
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 27 16:36:29 2022 +0000
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 27 Jan 2022 17:45:03 +0100 |
parents | 1a6421c5be20 |
children | 4cea92e99a5a |
comparison
equal
deleted
inserted
replaced
27405:9265a363d1ab | 27406:4c1bdee75bed |
---|---|
1329 stack->ga_len -= argcount; | 1329 stack->ga_len -= argcount; |
1330 type = internal_func_ret_type(func_idx, argcount, argtypes); | 1330 type = internal_func_ret_type(func_idx, argcount, argtypes); |
1331 if (push_type_stack(cctx, type) == FAIL) | 1331 if (push_type_stack(cctx, type) == FAIL) |
1332 return FAIL; | 1332 return FAIL; |
1333 | 1333 |
1334 if (maptype != NULL && maptype[0].type_curr->tt_member != NULL | 1334 if (maptype != NULL && maptype[0].type_decl->tt_member != NULL |
1335 && maptype[0].type_curr->tt_member != &t_any) | 1335 && maptype[0].type_decl->tt_member != &t_any) |
1336 // Check that map() didn't change the item types. | 1336 // Check that map() didn't change the item types. |
1337 generate_TYPECHECK(cctx, maptype[0].type_curr, -1, 1); | 1337 generate_TYPECHECK(cctx, maptype[0].type_decl, -1, 1); |
1338 | 1338 |
1339 return OK; | 1339 return OK; |
1340 } | 1340 } |
1341 | 1341 |
1342 /* | 1342 /* |