0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.1176: Vim9: not enough type checking in Vim9 script

Problem:    Vim9: not enough type checking in Vim9 script.
Solution:   Use same type checking as in a :def function.
This commit is contained in:
Bram Moolenaar
2020-07-10 22:45:38 +02:00
parent 7ff78465f7
commit 543e6f3467
5 changed files with 41 additions and 3 deletions

View File

@@ -2460,8 +2460,16 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
}
if (evalarg != NULL && (evalarg->eval_flags & EVAL_EVALUATE))
{
int ret = typval_compare(rettv, &var2, type, ic);
int ret;
if (in_vim9script() && check_compare_types(
type, rettv, &var2) == FAIL)
{
ret = FAIL;
clear_tv(rettv);
}
else
ret = typval_compare(rettv, &var2, type, ic);
clear_tv(&var2);
return ret;
}