patch 9.0.0090: no error when assigning bool to a string option
Problem: No error when assigning bool to a string option with setwinvar().
Solution: Give an error (closes #10766)
diff --git a/src/evalvars.c b/src/evalvars.c
index d4e8d29..7e6bf7a 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -4223,6 +4223,11 @@
if (varp->v_type == VAR_BOOL)
{
+ if (is_string_option(varname))
+ {
+ emsg(_(e_string_required));
+ return;
+ }
numval = (long)varp->vval.v_number;
strval = (char_u *)"0"; // avoid using "false"
}