]> granicus.if.org Git - vim/commitdiff
patch 8.2.1390: Vim9: type error after storing an option value v8.2.1390
authorBram Moolenaar <Bram@vim.org>
Fri, 7 Aug 2020 19:28:34 +0000 (21:28 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 7 Aug 2020 19:28:34 +0000 (21:28 +0200)
Problem:    Vim9: type error after storing an option value.
Solution:   Drop the type after a STOREOPT instruction. (closes #6632)

src/testdir/test_vim9_script.vim
src/version.c
src/vim9compile.c

index 2faa737962b42e671ef7e10dfb9f684c1c92b425..c4a6f9a28b4b82f73aadb0cbe67662115757aba9 100644 (file)
@@ -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()
index 1ac4940e1ecad9128b53cb0191b2486bdd4d0253..8b68bc164d5d7dee77d10e3f41a003b7ecba50a5 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1390,
 /**/
     1389,
 /**/
index 570885af1f10483e81428e29ca11d0ddd0ffff49..a6b4a27db8354d6edaa72aab988defdd624fea15 100644 (file)
@@ -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;