Patch 8.2.1600
Problem: Vim9: cannot use "true" with deepcopy().
Solution: Use tv_get_bool_chk(). (closes #6867)
Files: src/evalfunc.c, src/testdir/test_vim9_func.vim,
src/testdir/test_listdict.vim
*** ../vim-8.2.1599/src/evalfunc.c 2020-09-04 19:50:53.808691766 +0200
--- src/evalfunc.c 2020-09-05 17:15:06.293850153 +0200
***************
*** 1975,1981 ****
int copyID;
if (argvars[1].v_type != VAR_UNKNOWN)
! noref = (int)tv_get_number_chk(&argvars[1], NULL);
if (noref < 0 || noref > 1)
emsg(_(e_invarg));
else
--- 1975,1981 ----
int copyID;
if (argvars[1].v_type != VAR_UNKNOWN)
! noref = (int)tv_get_bool_chk(&argvars[1], NULL);
if (noref < 0 || noref > 1)
emsg(_(e_invarg));
else
*** ../vim-8.2.1599/src/testdir/test_vim9_func.vim 2020-09-04 21:18:40.492161906 +0200
--- src/testdir/test_vim9_func.vim 2020-09-05 17:13:25.478062824 +0200
***************
*** 1272,1277 ****
--- 1272,1279 ----
res += n
endfor
assert_equal(6, res)
+
+ dl = deepcopy([1, 2, 3], true)
enddef
def Test_extend_return_type()
*** ../vim-8.2.1599/src/testdir/test_listdict.vim 2020-09-04 21:18:40.484161926 +0200
--- src/testdir/test_listdict.vim 2020-09-05 17:17:32.701538774 +0200
***************
*** 348,354 ****
let l[1] = l2
let l3 = deepcopy(l2)
call assert_true(l3[1] is l3[2])
! call assert_fails("call deepcopy([1, 2], 2)", 'E474:')
endfunc
" Locked variables
--- 348,354 ----
let l[1] = l2
let l3 = deepcopy(l2)
call assert_true(l3[1] is l3[2])
! call assert_fails("call deepcopy([1, 2], 2)", 'E1023:')
endfunc
" Locked variables
*** ../vim-8.2.1599/src/version.c 2020-09-05 17:03:31.923261682 +0200
--- src/version.c 2020-09-05 17:14:24.229939095 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1600,
/**/
--
ARTHUR: What?
BLACK KNIGHT: None shall pass.
ARTHUR: I have no quarrel with you, good Sir knight, but I must cross
this bridge.
BLACK KNIGHT: Then you shall die.
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language --
http://www.Zimbu.org ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///