Mercurial > vim
comparison src/eval.c @ 21251:d1215fcdbca8 v8.2.1176
patch 8.2.1176: Vim9: not enough type checking in Vim9 script
Commit: https://github.com/vim/vim/commit/543e6f3467f208930a5d7fadb82133334bf31356
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 10 22:45:38 2020 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 10 Jul 2020 23:00:03 +0200 |
parents | ad13736a1783 |
children | 1e5c29d4e5b3 |
comparison
equal
deleted
inserted
replaced
21250:21fb2a3ad3ca | 21251:d1215fcdbca8 |
---|---|
2458 clear_tv(rettv); | 2458 clear_tv(rettv); |
2459 return FAIL; | 2459 return FAIL; |
2460 } | 2460 } |
2461 if (evalarg != NULL && (evalarg->eval_flags & EVAL_EVALUATE)) | 2461 if (evalarg != NULL && (evalarg->eval_flags & EVAL_EVALUATE)) |
2462 { | 2462 { |
2463 int ret = typval_compare(rettv, &var2, type, ic); | 2463 int ret; |
2464 | 2464 |
2465 if (in_vim9script() && check_compare_types( | |
2466 type, rettv, &var2) == FAIL) | |
2467 { | |
2468 ret = FAIL; | |
2469 clear_tv(rettv); | |
2470 } | |
2471 else | |
2472 ret = typval_compare(rettv, &var2, type, ic); | |
2465 clear_tv(&var2); | 2473 clear_tv(&var2); |
2466 return ret; | 2474 return ret; |
2467 } | 2475 } |
2468 } | 2476 } |
2469 | 2477 |