Skip to content

Commit eb26f43

Browse files
committed
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 #6936)
1 parent 3bd8de4 commit eb26f43

3 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/testdir/test_vim9_expr.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ def Test_expr4_equal()
481481
set noignorecase
482482

483483
CheckDefFailure(["let x = 'a' == xxx"], 'E1001:', 1)
484+
CheckDefExecFailure(['let items: any', 'eval 1', 'eval 2', 'if items == []', 'endif'], 'E691:', 4)
484485

485486
let bb = 0z3f
486487
assert_equal(true, 0z3f == bb)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
1680,
753755
/**/
754756
1679,
755757
/**/

src/vim9execute.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,6 +2126,7 @@ call_def_function(
21262126
exptype_T exptype = iptr->isn_arg.op.op_type;
21272127
int ic = iptr->isn_arg.op.op_ic;
21282128

2129+
SOURCING_LNUM = iptr->isn_lnum;
21292130
typval_compare(tv1, tv2, exptype, ic);
21302131
clear_tv(tv2);
21312132
--ectx.ec_stack.ga_len;

0 commit comments

Comments
 (0)