0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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

@@ -4652,14 +4652,17 @@ exec_instructions(ectx_T *ectx)
case ISN_CHECKTYPE:
{
checktype_T *ct = &iptr->isn_arg.type;
int save_wt_variable = ectx->ec_where.wt_variable;
tv = STACK_TV_BOT((int)ct->ct_off);
SOURCING_LNUM = iptr->isn_lnum;
if (!ectx->ec_where.wt_variable)
ectx->ec_where.wt_index = ct->ct_arg_idx;
ectx->ec_where.wt_variable = ct->ct_is_var;
if (check_typval_type(ct->ct_type, tv, ectx->ec_where)
== FAIL)
goto on_error;
ectx->ec_where.wt_variable = save_wt_variable;
if (!ectx->ec_where.wt_variable)
ectx->ec_where.wt_index = 0;
@@ -6114,18 +6117,19 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc)
case ISN_CHECKTYPE:
{
checktype_T *ct = &iptr->isn_arg.type;
char *tofree;
checktype_T *ct = &iptr->isn_arg.type;
char *tofree;
if (ct->ct_arg_idx == 0)
smsg("%s%4d CHECKTYPE %s stack[%d]", pfx, current,
type_name(ct->ct_type, &tofree),
(int)ct->ct_off);
else
smsg("%s%4d CHECKTYPE %s stack[%d] arg %d",
smsg("%s%4d CHECKTYPE %s stack[%d] %s %d",
pfx, current,
type_name(ct->ct_type, &tofree),
(int)ct->ct_off,
ct->ct_is_var ? "var": "arg",
(int)ct->ct_arg_idx);
vim_free(tofree);
break;