patch 9.0.1977: Vim9: object members can change type
Problem: Vim9: object members can change type
Solution: Check type during assignment to object/class var
closes: #13127
closes: #13262
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
diff --git a/src/structs.h b/src/structs.h
index 8443a42..c7360a3 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1509,10 +1509,11 @@
* Entry for an object or class member variable.
*/
typedef struct {
- char_u *ocm_name; // allocated
+ char_u *ocm_name; // allocated
omacc_T ocm_access;
+ int ocm_has_type; // type specified explicitly
type_T *ocm_type;
- char_u *ocm_init; // allocated
+ char_u *ocm_init; // allocated
} ocmember_T;
// used for the lookup table of a class member index and object method index