1
0
forked from aniani/vim

patch 8.2.1272: Vim9: type not checked if declaration also assigns value

Problem:    Vim9: type not checked if declaration also assigns value.
Solution:   Check the type. (issue #6507)
This commit is contained in:
Bram Moolenaar
2020-07-22 21:45:14 +02:00
parent 0f60e80f9b
commit 4cdb13ce81
7 changed files with 105 additions and 74 deletions

View File

@@ -737,7 +737,8 @@ call_def_function(
for (idx = 0; idx < argc; ++idx)
{
if (ufunc->uf_arg_types != NULL && idx < ufunc->uf_args.ga_len
&& check_argtype(ufunc->uf_arg_types[idx], &argv[idx]) == FAIL)
&& check_typval_type(ufunc->uf_arg_types[idx], &argv[idx])
== FAIL)
goto failed_early;
copy_tv(&argv[idx], STACK_TV_BOT(0));
++ectx.ec_stack.ga_len;