Mercurial > vim
comparison src/vim9compile.c @ 25483:0160aff01c32 v8.2.3278
patch 8.2.3278: Vim9: error when adding 1 to float
Commit: https://github.com/vim/vim/commit/7bf9a07bd7d6264f623109c2896b2a4002c86080
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 2 21:55:15 2021 +0200
patch 8.2.3278: Vim9: error when adding 1 to float
Problem: Vim9: error when adding 1 to float.
Solution: Accept t_number_bool. (closes https://github.com/vim/vim/issues/8687)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 02 Aug 2021 22:00:06 +0200 |
parents | a975e2b7ea31 |
children | 1ac82ad3ee01 |
comparison
equal
deleted
inserted
replaced
25482:e4e9d42dfd67 | 25483:0160aff01c32 |
---|---|
7109 expected = lhs.lhs_member_type; | 7109 expected = lhs.lhs_member_type; |
7110 stacktype = ((type_T **)stack->ga_data)[stack->ga_len - 1]; | 7110 stacktype = ((type_T **)stack->ga_data)[stack->ga_len - 1]; |
7111 if ( | 7111 if ( |
7112 #ifdef FEAT_FLOAT | 7112 #ifdef FEAT_FLOAT |
7113 // If variable is float operation with number is OK. | 7113 // If variable is float operation with number is OK. |
7114 !(expected == &t_float && stacktype == &t_number) && | 7114 !(expected == &t_float && (stacktype == &t_number |
7115 || stacktype == &t_number_bool)) && | |
7115 #endif | 7116 #endif |
7116 need_type(stacktype, expected, -1, 0, cctx, | 7117 need_type(stacktype, expected, -1, 0, cctx, |
7117 FALSE, FALSE) == FAIL) | 7118 FALSE, FALSE) == FAIL) |
7118 goto theend; | 7119 goto theend; |
7119 } | 7120 } |