]> granicus.if.org Git - vim/commitdiff
patch 8.2.1680: Vim9: line number for compare error is wrong v8.2.1680
authorBram Moolenaar <Bram@vim.org>
Mon, 14 Sep 2020 14:50:05 +0000 (16:50 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 14 Sep 2020 14:50:05 +0000 (16:50 +0200)
Problem:    Vim9: line number for compare error is wrong.
Solution:   Set SOURCING_LNUM. (closes #6936)

src/testdir/test_vim9_expr.vim
src/version.c
src/vim9execute.c

index 84e8cb3ccf78b25ea4cc8efa720e8de863592a87..b09242e91cc8e89f1a17ca172b7455bc0c4b703e 100644 (file)
@@ -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)
index a04f93ca263603f6aef1302901a0c8e9a2cd74a7..89ef82a347176e0e3d3aa983953e98ecbf70b3b8 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1680,
 /**/
     1679,
 /**/
index e93817a62bb1237a4b2067650610c6645d805b53..c2bd857ab02fc545765c9ac1eac7ee67b4d96481 100644 (file)
@@ -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;