summaryrefslogtreecommitdiff
path: root/src/vim9execute.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-15 23:36:40 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-15 23:36:40 +0200
commita6e67e4f41386c3e6eab7e047671c6d32f6cb0dc (patch)
treee7434456fea959f5fda2059de5922f31a962bf46 /src/vim9execute.c
parent4457e1d98f78152311495b1aff6169383d330a75 (diff)
downloadvim-git-8.2.0764.tar.gz
patch 8.2.0764: Vim9: assigning to option not fully testedv8.2.0764
Problem: Vim9: assigning to option not fully tested. Solution: Add more test cases. Allow using any type for assignment.
Diffstat (limited to 'src/vim9execute.c')
-rw-r--r--src/vim9execute.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/vim9execute.c b/src/vim9execute.c
index f50f8c6e1..398c94c42 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -1164,13 +1164,9 @@ call_def_function(
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)