neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 38c113ae842aa8c42ad66bba15f16cf401637ab8
parent e25193143bca3a48920322634120a442854bb891
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Sat,  5 Nov 2022 17:43:38 +0800

vim-patch:8.2.1600: Vim9: cannot use "true" with deepcopy()

Problem:    Vim9: cannot use "true" with deepcopy().
Solution:   Use tv_get_bool_chk(). (closes vim/vim#6867)

https://github.com/vim/vim/commit/44b4a246b62e0622550b963bcf3034dce3bcfc0c

Co-authored-by: Bram Moolenaar <Bram@vim.org>

Diffstat:
Msrc/nvim/eval/funcs.c | 2+-
Msrc/nvim/testdir/test_listdict.vim | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c @@ -1360,7 +1360,7 @@ static void f_deepcopy(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) int noref = 0; if (argvars[1].v_type != VAR_UNKNOWN) { - noref = (int)tv_get_number_chk(&argvars[1], NULL); + noref = (int)tv_get_bool_chk(&argvars[1], NULL); } if (noref < 0 || noref > 1) { semsg(_(e_using_number_as_bool_nr), noref); diff --git a/src/nvim/testdir/test_listdict.vim b/src/nvim/testdir/test_listdict.vim @@ -336,12 +336,12 @@ func Test_dict_deepcopy() let l = [4, d, 6] let d[3] = l let dc = deepcopy(d) - call assert_fails('call deepcopy(d, 1)', 'E698') + call assert_fails('call deepcopy(d, 1)', 'E698:') let l2 = [0, l, l, 3] 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:') + call assert_fails("call deepcopy([1, 2], 2)", 'E1023:') endfunc " Locked variables