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)

44b4a246b6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2022-11-05 17:43:38 +08:00
parent e25193143b
commit 38c113ae84
2 changed files with 3 additions and 3 deletions

View File

@@ -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);