To: vim_dev@googlegroups.com Subject: Patch 8.2.3278 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3278 Problem: Vim9: error when adding 1 to float. Solution: Accept t_number_bool. (closes #8687) Files: src/vim9compile.c, src/testdir/test_vim9_assign.vim *** ../vim-8.2.3277/src/vim9compile.c 2021-08-02 21:12:00.547189090 +0200 --- src/vim9compile.c 2021-08-02 21:53:49.167049021 +0200 *************** *** 7111,7117 **** if ( #ifdef FEAT_FLOAT // If variable is float operation with number is OK. ! !(expected == &t_float && stacktype == &t_number) && #endif need_type(stacktype, expected, -1, 0, cctx, FALSE, FALSE) == FAIL) --- 7111,7118 ---- if ( #ifdef FEAT_FLOAT // If variable is float operation with number is OK. ! !(expected == &t_float && (stacktype == &t_number ! || stacktype == &t_number_bool)) && #endif need_type(stacktype, expected, -1, 0, cctx, FALSE, FALSE) == FAIL) *** ../vim-8.2.3277/src/testdir/test_vim9_assign.vim 2021-08-01 13:17:12.862422853 +0200 --- src/testdir/test_vim9_assign.vim 2021-08-02 21:53:14.999202131 +0200 *************** *** 223,228 **** --- 223,234 ---- g:inc_counter += 1 assert_equal(2, g:inc_counter) + if has('float') + var f: float + f += 1 + assert_equal(1.0, f) + endif + $SOME_ENV_VAR ..= 'more' assert_equal('somemore', $SOME_ENV_VAR) CheckDefFailure(['$SOME_ENV_VAR += "more"'], 'E1051:') *** ../vim-8.2.3277/src/version.c 2021-08-02 21:12:00.547189090 +0200 --- src/version.c 2021-08-02 21:51:00.903824947 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3278, /**/ -- Not too long ago, compress was something you did to garbage... /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///