diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-07-10 22:45:38 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-07-10 22:45:38 +0200 |
commit | 543e6f3467f208930a5d7fadb82133334bf31356 (patch) | |
tree | 25b194a6701e6eab32449218d4f8dd0d6d93eb81 /src/eval.c | |
parent | 7ff78465f7057a672a6de0d75d56286da253501b (diff) | |
download | vim-git-543e6f3467f208930a5d7fadb82133334bf31356.tar.gz |
patch 8.2.1176: Vim9: not enough type checking in Vim9 scriptv8.2.1176
Problem: Vim9: not enough type checking in Vim9 script.
Solution: Use same type checking as in a :def function.
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 6a1bc4c7a..595cd0666 100644 --- a/src/eval.c +++ b/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; } |