Problem: Vim9: variable may be locked unintentionally.
Solution: Clear "v_lock". (closes #10036)
assert_fails('bufname([])', 'E1220:')
enddef
+let s:bufnr_res = 0
+
def Test_bufnr()
var buf = bufnr()
bufnr('%')->assert_equal(buf)
+ # check the lock is not taken over through the stack
+ const nr = 10
+ bufnr_res = bufnr()
+ bufnr_res = 12345
+
buf = bufnr('Xdummy', true)
buf->assert_notequal(-1)
exe 'bwipe! ' .. buf
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4643,
/**/
4642,
/**/
tv = STACK_TV_BOT(-1);
tv->v_type = VAR_NUMBER;
tv->vval.v_number = 0;
+ tv->v_lock = 0;
return OK;
}