patch 8.2.2012: Vim9: confusing error message when using bool wrongly
Problem: Vim9: confusing error message when using bool wrongly.
Solution: Mention "Bool" instead of "Special". (closes #7323)
diff --git a/src/typval.c b/src/typval.c
index 7c55d3a..0e2513a 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -213,7 +213,10 @@
case VAR_SPECIAL:
if (!want_bool && in_vim9script())
{
- emsg(_("E611: Using a Special as a Number"));
+ if (varp->v_type == VAR_BOOL)
+ emsg(_(e_using_bool_as_number));
+ else
+ emsg(_("E611: Using a Special as a Number"));
break;
}
return varp->vval.v_number == VVAL_TRUE ? 1 : 0;