Mercurial > vim
diff src/vim9instr.c @ 28901:11609f025219 v8.2.4973
patch 8.2.4973: Vim9: type error for list unpack mentions argument
Commit: https://github.com/vim/vim/commit/bd3a9d2c946bae0427d7c9b9249716064935fb4e
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 17 16:12:39 2022 +0100
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 https://github.com/vim/vim/issues/10435)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 17 May 2022 17:15:03 +0200 |
parents | 3626ca6a20ea |
children | 0e9642706a59 |
line wrap: on
line diff
--- a/src/vim9instr.c +++ b/src/vim9instr.c @@ -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_id 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; }