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 -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202108021955.172JtgAJ599960%40masaka.moolenaar.net.