patch 8.2.1751: using 2 where bool is expected may throw an error
Problem: Using 2 where bool is expected may throw an error.
Solution: Make this backwards compatible.
diff --git a/src/typval.c b/src/typval.c
index 1db0d77..5151f72 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -177,7 +177,7 @@
switch (varp->v_type)
{
case VAR_NUMBER:
- if (want_bool && varp->vval.v_number != 0
+ if (in_vim9script() && want_bool && varp->vval.v_number != 0
&& varp->vval.v_number != 1)
{
semsg(_(e_using_number_as_bool_nr), varp->vval.v_number);