patch 9.0.2049: Vim9: not recognizing qualified class vars for infix ops
Problem: Vim9: not recognizing qualified class vars for infix ops
Solution: Drop the class type from the stack before generating the
CLASSMEMBER instruction
closes: #13378
closes: #13379
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
diff --git a/src/vim9expr.c b/src/vim9expr.c
index 85eb7af..41ed7e7 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -379,6 +379,8 @@
}
if (type->tt_type == VAR_CLASS)
{
+ // Remove the class type from the stack
+ --cctx->ctx_type_stack.ga_len;
if (generate_CLASSMEMBER(cctx, TRUE, cl, m_idx) == FAIL)
return FAIL;
}
@@ -475,6 +477,8 @@
}
*arg = name_end;
+ // Remove the class type from the stack
+ --cctx->ctx_type_stack.ga_len;
return generate_CLASSMEMBER(cctx, TRUE, cl, idx);
}