0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.1977: Vim9: error for using a string in a condition is confusing

Problem:    Vim9: error for using a string in a condition is confusing.
Solution:   Give a more specific error.  Also adjust the compile time type
            checking for || and &&.
This commit is contained in:
Bram Moolenaar
2020-11-12 12:08:51 +01:00
parent 6f6244855f
commit ea2d407f9c
9 changed files with 83 additions and 53 deletions

View File

@@ -196,7 +196,7 @@ tv_get_bool_or_number_chk(typval_T *varp, int *denote, int want_bool)
case VAR_STRING:
if (in_vim9script())
{
emsg(_(e_using_string_as_number));
emsg_using_string_as(varp, !want_bool);
break;
}
if (varp->vval.v_string != NULL)