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:
10
src/eval.c
10
src/eval.c
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user