0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.0.2156: Vim9: can use typealias in assignment

Problem:  Vim9: can use typealias in an assignment
Solution: Generate errors when class/typealias involved in the rhs of an
          assignment

closes: #13637

Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Generate errors when class/typealias involved in assignment.
This commit is contained in:
Ernie Rael
2023-12-11 17:40:46 +01:00
committed by Christian Brabandt
parent fa920da283
commit 9ed53752df
10 changed files with 156 additions and 22 deletions

View File

@@ -2797,6 +2797,8 @@ compile_assignment(
rhs_type = cctx->ctx_type_stack.ga_len == 0 ? &t_void
: get_type_on_stack(cctx, 0);
if (check_type_is_value(rhs_type) == FAIL)
goto theend;
if (lhs.lhs_lvar != NULL && (is_decl || !lhs.lhs_has_type))
{
if ((rhs_type->tt_type == VAR_FUNC