0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.1390: Vim9: type error after storing an option value

Problem:    Vim9: type error after storing an option value.
Solution:   Drop the type after a STOREOPT instruction. (closes #6632)
This commit is contained in:
Bram Moolenaar
2020-08-07 21:28:34 +02:00
parent 74d95b5b58
commit 1c199f9c70
3 changed files with 8 additions and 1 deletions

View File

@@ -422,6 +422,11 @@ def Test_assignment_var_list()
assert_equal('one', v1) assert_equal('one', v1)
assert_equal('two', v2) assert_equal('two', v2)
assert_equal(['three'], vrem) assert_equal(['three'], vrem)
[&ts, &sw] = [3, 4]
assert_equal(3, &ts)
assert_equal(4, &sw)
set ts=8 sw=4
enddef enddef
def Test_assignment_vim9script() def Test_assignment_vim9script()

View File

@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1390,
/**/ /**/
1389, 1389,
/**/ /**/

View File

@@ -1336,7 +1336,7 @@ generate_STOREOPT(cctx_T *cctx, char_u *name, int opt_flags)
isn_T *isn; isn_T *isn;
RETURN_OK_IF_SKIP(cctx); 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; return FAIL;
isn->isn_arg.storeopt.so_name = vim_strsave(name); isn->isn_arg.storeopt.so_name = vim_strsave(name);
isn->isn_arg.storeopt.so_flags = opt_flags; isn->isn_arg.storeopt.so_flags = opt_flags;