patch 8.2.2261: Vim9: boolean option gets string type
Problem: Vim9: boolean option gets string type.
Solution: Check for VAR_BOOL. (closes #7588)
diff --git a/src/vim9compile.c b/src/vim9compile.c
index b483a60..d44fe48 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3172,8 +3172,9 @@
if (ret == OK)
{
// include the '&' in the name, eval_option() expects it.
- char_u *name = vim_strnsave(start, *arg - start);
- type_T *type = rettv.v_type == VAR_NUMBER ? &t_number : &t_string;
+ char_u *name = vim_strnsave(start, *arg - start);
+ type_T *type = rettv.v_type == VAR_BOOL ? &t_bool
+ : rettv.v_type == VAR_NUMBER ? &t_number : &t_string;
ret = generate_LOAD(cctx, ISN_LOADOPT, 0, name, type);
vim_free(name);