patch 9.0.2170: Vim9: no support for const/final class/objects vars
Problem: Vim9: no support for const/final class/objects vars
Solution: Support final and const object and class variables
closes: #13655
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 882b13c..3bcdce4 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -4455,7 +4455,11 @@
else
{
*tv = *STACK_TV_VAR(0);
- ++tv->vval.v_object->obj_refcount;
+ object_T *obj = tv->vval.v_object;
+ ++obj->obj_refcount;
+
+ // Lock all the constant object variables
+ obj_lock_const_vars(obj);
}
// FALLTHROUGH