0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.1108: type error when using "any" type and adding to float

Problem:    Type error when using "any" type and adding a number to a float.
Solution:   Accept both a number and a float. (closes #11753)
This commit is contained in:
Bram Moolenaar
2022-12-29 20:56:24 +00:00
parent 73ade49c4b
commit c6951a76a5
12 changed files with 117 additions and 54 deletions

View File

@@ -6872,16 +6872,23 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc)
case ISN_CHECKTYPE:
{
checktype_T *ct = &iptr->isn_arg.type;
char *tofree;
char *tofree = NULL;
char *typename;
if (ct->ct_type->tt_type == VAR_FLOAT
&& (ct->ct_type->tt_flags & TTFLAG_NUMBER_OK))
typename = "float|number";
else
typename = type_name(ct->ct_type, &tofree);
if (ct->ct_arg_idx == 0)
smsg("%s%4d CHECKTYPE %s stack[%d]", pfx, current,
type_name(ct->ct_type, &tofree),
typename,
(int)ct->ct_off);
else
smsg("%s%4d CHECKTYPE %s stack[%d] %s %d",
pfx, current,
type_name(ct->ct_type, &tofree),
typename,
(int)ct->ct_off,
ct->ct_is_var ? "var": "arg",
(int)ct->ct_arg_idx);