diff src/vim9script.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 85cf06ddb2a8
children 39cf2d8e7edf
line wrap: on
line diff
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -650,7 +650,7 @@ vim9_declare_scriptvar(exarg_T *eap, cha
 	init_tv.v_type = VAR_NUMBER;
     else
 	init_tv.v_type = type->tt_type;
-    set_var_const(name, type, &init_tv, FALSE, 0);
+    set_var_const(name, type, &init_tv, FALSE, 0, 0);
 
     vim_free(name);
     return p;
@@ -855,7 +855,7 @@ find_typval_in_script(typval_T *dest)
 	if (sv->sv_name != NULL && sv->sv_tv == dest)
 	    return sv;
     }
-    iemsg("check_script_var_type(): not found");
+    iemsg("find_typval_in_script(): not found");
     return NULL;
 }
 
@@ -864,7 +864,11 @@ find_typval_in_script(typval_T *dest)
  * If needed convert "value" to a bool.
  */
     int
-check_script_var_type(typval_T *dest, typval_T *value, char_u *name)
+check_script_var_type(
+	typval_T    *dest,
+	typval_T    *value,
+	char_u	    *name,
+	where_T	    where)
 {
     svar_T  *sv = find_typval_in_script(dest);
     int	    ret;
@@ -876,7 +880,7 @@ check_script_var_type(typval_T *dest, ty
 	    semsg(_(e_readonlyvar), name);
 	    return FAIL;
 	}
-	ret = check_typval_type(sv->sv_type, value, 0);
+	ret = check_typval_type(sv->sv_type, value, where);
 	if (ret == OK && need_convert_to_bool(sv->sv_type, value))
 	{
 	    int	val = tv2bool(value);