Patch 9.0.0499
Problem: In :def function list created after const is locked.
Solution: Reset v_lock. (closes #11154)
Files: src/vim9execute.c, src/testdir/test_vim9_assign.vim
*** ../vim-9.0.0498/src/vim9execute.c 2022-09-18 12:00:16.260337802 +0100
--- src/vim9execute.c 2022-09-18 13:45:33.479731972 +0100
***************
*** 200,205 ****
--- 200,206 ----
tv = STACK_TV_BOT(-1);
tv->v_type = VAR_LIST;
tv->vval.v_list = list;
+ tv->v_lock = 0;
if (list != NULL)
++list->lv_refcount;
return OK;
*** ../vim-9.0.0498/src/testdir/test_vim9_assign.vim 2022-09-17 21:07:52.111993132 +0100
--- src/testdir/test_vim9_assign.vim 2022-09-18 13:44:09.267919330 +0100
***************
*** 2023,2028 ****
--- 2023,2035 ----
unlet w:FLIST
enddef
+ def Test_create_list_after_const()
+ const a = 1
+ g:ll = []
+ assert_equal(0, islocked('g:ll'))
+ unlet g:ll
+ enddef
+
def Test_var_declaration_fails()
var lines =<< trim END
vim9script
*** ../vim-9.0.0498/src/version.c 2022-09-18 13:06:36.461124371 +0100
--- src/version.c 2022-09-18 13:45:08.459787596 +0100
***************
*** 701,702 ****
--- 701,704 ----
{ /* Add new patch number below this line */
+ /**/
+ 499,
/**/
--
The primary purpose of the DATA statement is to give names to constants;
instead of referring to pi as 3.141592653589793 at every appearance, the
variable PI can be given that value with a DATA statement and used instead
of the longer form of the constant. This also simplifies modifying the
program, should the value of pi change.
-- FORTRAN manual for Xerox Computers
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///