Problem: Line number for error is off by one.
Solution: Remember the line number of the comparison. (closes #9923)
int vim9script = in_vim9script();
int evaluate = evalarg == NULL
? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
+ long comp_lnum = SOURCING_LNUM;
if (getnext)
{
{
int ret;
+ // use the line of the comparison for messages
+ SOURCING_LNUM = comp_lnum;
if (vim9script && check_compare_types(type, rettv, &var2) == FAIL)
{
ret = FAIL;
v9.CheckDefAndScriptFailure(['echo [] == v:none'], 'E1072: Cannot compare list with special')
v9.CheckDefAndScriptFailure(['echo 123 == v:none'], 'E1072: Cannot compare number with special')
v9.CheckDefAndScriptFailure(['echo 0z00 == v:none'], 'E1072: Cannot compare blob with special')
+
+ lines =<< trim END
+ echo [] == v:none
+
+ eval 0 + 0
+ END
+ v9.CheckDefAndScriptFailure(lines, 'E1072:', 1)
enddef
def Test_expr4_wrong_type()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4540,
/**/
4539,
/**/