From 58b40092e616585a763cf4d214d47ccd9167d6f7 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 11 Jan 2023 15:59:05 +0000 Subject: patch 9.0.1178: a child class cannot override functions from a base class Problem: A child class cannot override functions from a base class. Solution: Allow overriding and implement "super". --- src/globals.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/globals.h') diff --git a/src/globals.h b/src/globals.h index fd5a0cb020..8c3cb62e43 100644 --- a/src/globals.h +++ b/src/globals.h @@ -527,7 +527,10 @@ EXTERN int garbage_collect_at_exit INIT(= FALSE); #define t_dict_string (static_types[76]) #define t_const_dict_string (static_types[77]) -EXTERN type_T static_types[78] +#define t_super (static_types[78]) +#define t_const_super (static_types[79]) + +EXTERN type_T static_types[80] #ifdef DO_INIT = { // 0: t_unknown @@ -685,6 +688,10 @@ EXTERN type_T static_types[78] // 76: t_dict_string {VAR_DICT, 0, 0, TTFLAG_STATIC, &t_string, NULL}, {VAR_DICT, 0, 0, TTFLAG_STATIC|TTFLAG_CONST, &t_string, NULL}, + + // 78: t_super (VAR_CLASS with tt_member set to &t_bool + {VAR_CLASS, 0, 0, TTFLAG_STATIC, &t_bool, NULL}, + {VAR_CLASS, 0, 0, TTFLAG_STATIC|TTFLAG_CONST, &t_bool, NULL}, } #endif ; -- cgit v1.2.3