changeset 22262:3f082bd15d29 v8.2.1680

patch 8.2.1680: Vim9: line number for compare error is wrong Commit: https://github.com/vim/vim/commit/eb26f4331f607b1639bf01f4f35ad3ce7d20cb10 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 14 16:50:05 2020 +0200 patch 8.2.1680: Vim9: line number for compare error is wrong Problem: Vim9: line number for compare error is wrong. Solution: Set SOURCING_LNUM. (closes https://github.com/vim/vim/issues/6936)
author Bram Moolenaar <Bram@vim.org>
date Mon, 14 Sep 2020 17:00:03 +0200
parents d3e9d86fae88
children 8a31402b1f81
files src/testdir/test_vim9_expr.vim src/version.c src/vim9execute.c
diffstat 3 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -481,6 +481,7 @@ def Test_expr4_equal()
   set noignorecase
 
   CheckDefFailure(["let x = 'a' == xxx"], 'E1001:', 1)
+  CheckDefExecFailure(['let items: any', 'eval 1', 'eval 2', 'if items == []', 'endif'], 'E691:', 4)
 
   let bb = 0z3f
   assert_equal(true, 0z3f == bb)
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1680,
+/**/
     1679,
 /**/
     1678,
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -2126,6 +2126,7 @@ call_def_function(
 		    exptype_T	exptype = iptr->isn_arg.op.op_type;
 		    int		ic = iptr->isn_arg.op.op_ic;
 
+		    SOURCING_LNUM = iptr->isn_lnum;
 		    typval_compare(tv1, tv2, exptype, ic);
 		    clear_tv(tv2);
 		    --ectx.ec_stack.ga_len;