0
0
mirror of https://github.com/vim/vim.git synced 2025-11-13 22:54:27 -05:00

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

@@ -1270,7 +1270,12 @@ set_var_lval(
}
}
else
{
if (lp->ll_type != NULL
&& check_typval_type(lp->ll_type, rettv) == FAIL)
return;
set_var_const(lp->ll_name, lp->ll_type, rettv, copy, flags);
}
*endp = cc;
}
else if (var_check_lock(lp->ll_newkey == NULL