diff src/eval.c @ 23917:4b417b776b95 v8.2.2501

patch 8.2.2501: not always clear where an error is reported Commit: https://github.com/vim/vim/commit/f785aa1354208f6b644e891aa01f8f86d947af7e Author: Bram Moolenaar <Bram@vim.org> Date: Thu Feb 11 21:19:34 2021 +0100 patch 8.2.2501: not always clear where an error is reported Problem: Not always clear where an error is reported. Solution: Add the where_T structure and pass it around. (closes https://github.com/vim/vim/issues/7796)
author Bram Moolenaar <Bram@vim.org>
date Thu, 11 Feb 2021 21:30:04 +0100
parents 806dfc7c7995
children ba79ceac82ec
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -1299,8 +1299,9 @@ set_var_lval(
     char_u	*endp,
     typval_T	*rettv,
     int		copy,
-    int		flags,    // ASSIGN_CONST, ASSIGN_NO_DECL
-    char_u	*op)
+    int		flags,	    // ASSIGN_CONST, ASSIGN_NO_DECL
+    char_u	*op,
+    int		var_idx)    // index for "let [a, b] = list"
 {
     int		cc;
     listitem_T	*ri;
@@ -1390,9 +1391,10 @@ set_var_lval(
 	else
 	{
 	    if (lp->ll_type != NULL
-			   && check_typval_type(lp->ll_type, rettv, 0) == FAIL)
+		       && check_typval_arg_type(lp->ll_type, rettv, 0) == FAIL)
 		return;
-	    set_var_const(lp->ll_name, lp->ll_type, rettv, copy, flags);
+	    set_var_const(lp->ll_name, lp->ll_type, rettv, copy,
+							       flags, var_idx);
 	}
 	*endp = cc;
     }
@@ -1471,7 +1473,7 @@ set_var_lval(
 	}
 
 	if (lp->ll_valtype != NULL
-			&& check_typval_type(lp->ll_valtype, rettv, 0) == FAIL)
+		    && check_typval_arg_type(lp->ll_valtype, rettv, 0) == FAIL)
 	    return;
 
 	if (lp->ll_newkey != NULL)