# HG changeset patch # User Bram Moolenaar # Date 1599320703 -7200 # Node ID 0825ae9948f75eddea0fb7bd71de932645abe119 # Parent 2a7b430646c4e25a249ad1b777d75ec429d551c8 patch 8.2.1601: Vim9: cannot use 'true" with garbagecollect() Commit: https://github.com/vim/vim/commit/2df47310422f4a77e85de7901a5299923a1addd3 Author: Bram Moolenaar Date: Sat Sep 5 17:30:44 2020 +0200 patch 8.2.1601: Vim9: cannot use 'true" with garbagecollect() Problem: Vim9: cannot use 'true" with garbagecollect(). Solution: Use tv_get_bool(). (closes https://github.com/vim/vim/issues/6871) diff --git a/src/evalfunc.c b/src/evalfunc.c --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -2936,7 +2936,7 @@ f_garbagecollect(typval_T *argvars, typv // using Lists and Dicts internally. E.g.: ":echo [garbagecollect()]". want_garbage_collect = TRUE; - if (argvars[0].v_type != VAR_UNKNOWN && tv_get_number(&argvars[0]) == 1) + if (argvars[0].v_type != VAR_UNKNOWN && tv_get_bool(&argvars[0]) == 1) garbage_collect_at_exit = TRUE; } diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -1285,6 +1285,10 @@ def Test_extend_return_type() assert_equal(6, res) enddef +def Test_garbagecollect() + garbagecollect(true) +enddef + def Test_insert_return_type() let l = insert([2, 1], 3) let res = 0 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1601, +/**/ 1600, /**/ 1599,