0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.4576: Vim9: error for comparing with null can be annoying

Problem:    Vim9: error for comparing with null can be annoying.
Solution:   Allow comparing anything with null. (closes #9948)
This commit is contained in:
Bram Moolenaar
2022-03-15 20:21:33 +00:00
parent 139575de66
commit 056678184f
4 changed files with 36 additions and 30 deletions

View File

@@ -1417,12 +1417,9 @@ typval_compare_null(typval_T *tv1, typval_T *tv2)
default: break;
}
}
if (!in_vim9script())
return FALSE; // backwards compatible
semsg(_(e_cannot_compare_str_with_str),
vartype_name(tv1->v_type), vartype_name(tv2->v_type));
return MAYBE;
// although comparing null with number, float or bool is not very usefule
// we won't give an error
return FALSE;
}
/*