1
0
forked from aniani/vim

patch 8.2.4973: Vim9: type error for list unpack mentions argument

Problem:    Vim9: type error for list unpack mentions argument.
Solution:   Mention variable. (close #10435)
This commit is contained in:
Bram Moolenaar
2022-05-17 16:12:39 +01:00
parent 1ff9c44267
commit bd3a9d2c94
8 changed files with 20 additions and 10 deletions

View File

@@ -542,6 +542,7 @@ generate_TYPECHECK(
cctx_T *cctx,
type_T *expected,
int offset,
int is_var,
int argidx)
{
isn_T *isn;
@@ -551,6 +552,7 @@ generate_TYPECHECK(
return FAIL;
isn->isn_arg.type.ct_type = alloc_type(expected);
isn->isn_arg.type.ct_off = (int8_T)offset;
isn->isn_arg.type.ct_is_var = is_var;
isn->isn_arg.type.ct_arg_idx = (int8_T)argidx;
// type becomes expected
@@ -1437,7 +1439,7 @@ generate_BCALL(cctx_T *cctx, int func_idx, int argcount, int method_call)
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_decl, -1, 1);
generate_TYPECHECK(cctx, maptype[0].type_decl, -1, FALSE, 1);
return OK;
}