0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.2210: Vim9: allocating a type to set TTFLAG_BOOL_OK

Problem:    Vim9: allocating a type to set TTFLAG_BOOL_OK.
Solution:   Add t_number_bool.
This commit is contained in:
Bram Moolenaar
2020-12-25 13:20:41 +01:00
parent 9e68c32563
commit 3868f59466
4 changed files with 7 additions and 22 deletions

View File

@@ -376,18 +376,9 @@ typval2type(typval_T *tv, garray_T *type_gap)
if (type != NULL && type != &t_bool
&& (tv->v_type == VAR_NUMBER
&& (tv->vval.v_number == 0 || tv->vval.v_number == 1)))
{
type_T *newtype = get_type_ptr(type_gap);
// Number 0 and 1 and expression with "&&" or "||" can also be used
// for bool.
if (newtype != NULL)
{
*newtype = *type;
newtype->tt_flags = TTFLAG_BOOL_OK;
type = newtype;
}
}
// Number 0 and 1 and expression with "&&" or "||" can also be used for
// bool.
type = &t_number_bool;
return type;
}