diff src/vim9execute.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 d0241e74bfdb
children 8f599b6d9f54
line wrap: on
line diff
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -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 *inst
 
 	    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;