summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-07 21:28:34 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-07 21:28:34 +0200
commit1c199f9c70446933677d5210f34d2b86eefa2a43 (patch)
tree557ca9d93332c82c8057cb5357b7b35ac236e6b2
parent74d95b5b58a36697975c48192e84be808b2512a8 (diff)
patch 8.2.1390: Vim9: type error after storing an option valuev8.2.1390
Problem: Vim9: type error after storing an option value. Solution: Drop the type after a STOREOPT instruction. (closes #6632)
-rw-r--r--src/testdir/test_vim9_script.vim5
-rw-r--r--src/version.c2
-rw-r--r--src/vim9compile.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim
index 2faa737962..c4a6f9a28b 100644
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -422,6 +422,11 @@ def Test_assignment_var_list()
assert_equal('one', v1)
assert_equal('two', v2)
assert_equal(['three'], vrem)
+
+ [&ts, &sw] = [3, 4]
+ assert_equal(3, &ts)
+ assert_equal(4, &sw)
+ set ts=8 sw=4
enddef
def Test_assignment_vim9script()
diff --git a/src/version.c b/src/version.c
index 1ac4940e1e..8b68bc164d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1390,
+/**/
1389,
/**/
1388,
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 570885af1f..a6b4a27db8 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1336,7 +1336,7 @@ generate_STOREOPT(cctx_T *cctx, char_u *name, int opt_flags)
isn_T *isn;
RETURN_OK_IF_SKIP(cctx);
- if ((isn = generate_instr(cctx, ISN_STOREOPT)) == NULL)
+ if ((isn = generate_instr_drop(cctx, ISN_STOREOPT, 1)) == NULL)
return FAIL;
isn->isn_arg.storeopt.so_name = vim_strsave(name);
isn->isn_arg.storeopt.so_flags = opt_flags;