Problem: Vim9: Negating a float doesn't result in a boolean
(kennypete)
Solution: Make it return a boolean (Yegappan Lakshmanan).
related: #19282
related: #19289
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
{
rettv->v_type = VAR_BOOL;
val = f == 0.0 ? VVAL_TRUE : VVAL_FALSE;
+ type = VAR_BOOL;
}
else
f = !f;
assert_equal(false, ![1, 2, 3]->reverse())
assert_equal(true, ![]->reverse())
+
+ # float
+ assert_equal(true, !0.0)
+ assert_equal(false, !1.0)
+ assert_equal(false, !25.678)
END
v9.CheckDefAndScriptSuccess(lines)
enddef
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2122,
/**/
2121,
/**/