mirror of
https://github.com/zoriya/vim.git
synced 2025-12-20 14:15:18 +00:00
patch 8.2.2755: Vim9: no error for using a number in a condition
Problem: Vim9: no error for using a number in a condition.
Solution: Also use ISN_COND2BOOL if the type is t_number_bool.
(closes #7644)
This commit is contained in:
@@ -990,7 +990,7 @@ bool_on_stack(cctx_T *cctx)
|
||||
if (type == &t_bool)
|
||||
return OK;
|
||||
|
||||
if (type == &t_any || type == &t_number)
|
||||
if (type == &t_any || type == &t_number || type == &t_number_bool)
|
||||
// Number 0 and 1 are OK to use as a bool. "any" could also be a bool.
|
||||
// This requires a runtime type check.
|
||||
return generate_COND2BOOL(cctx);
|
||||
|
||||
Reference in New Issue
Block a user