patch 8.2.0764: Vim9: assigning to option not fully tested
Problem: Vim9: assigning to option not fully tested.
Solution: Add more test cases. Allow using any type for assignment.
diff --git a/src/vim9execute.c b/src/vim9execute.c
index f50f8c6..398c94c 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -1164,13 +1164,9 @@
if (s == NULL)
s = (char_u *)"";
}
- else if (tv->v_type == VAR_NUMBER)
- n = tv->vval.v_number;
else
- {
- emsg(_("E1051: Expected string or number"));
- goto failed;
- }
+ // must be VAR_NUMBER, CHECKTYPE makes sure
+ n = tv->vval.v_number;
msg = set_option_value(iptr->isn_arg.storeopt.so_name,
n, s, iptr->isn_arg.storeopt.so_flags);
if (msg != NULL)