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.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 5bd8907..b2d8fa0 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2797,6 +2797,8 @@
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