Skip to content

Commit 8cd6cb8

Browse files
committed
Fix broken toString methods
The const markers did not match the definition in hx::Object, so they were not overriding the parent class method correctly. If we remove them then they can be marked as override.
1 parent b30eef9 commit 8cd6cb8

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

include/Array.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ hx::Val Array_obj<ELEM_>::__Field(const String& inString, hx::PropertyAccess inC
15171517
bool __IsFunction() const { return true; } \
15181518
::Array_obj<ELEM_> *mThis; \
15191519
Reflective_##func(::Array_obj<ELEM_> *inThis) : mThis(inThis) { } \
1520-
::String toString() const { return HX_CSTRING(#func) ; } \
1520+
::String toString() override { return HX_CSTRING(#func) ; } \
15211521
::String __ToString() const override { return HX_CSTRING(#func) ; } \
15221522
int __GetType() const override { return vtFunction; } \
15231523
void *__GetHandle() const override { return mThis; } \

src/Array.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ struct ArrayBase_##func : public hx::Object \
513513
bool __IsFunction() const { return true; } \
514514
ArrayBase *mThis; \
515515
ArrayBase_##func(ArrayBase *inThis) : mThis(inThis) { } \
516-
String toString() const { return HX_CSTRING(#func) ; } \
516+
String toString() HXCPP_OVERRIDE { return HX_CSTRING(#func) ; } \
517517
String __ToString() const HXCPP_OVERRIDE { return HX_CSTRING(#func) ; } \
518518
int __GetType() const HXCPP_OVERRIDE { return vtFunction; } \
519519
void *__GetHandle() const HXCPP_OVERRIDE { return mThis; } \
@@ -881,7 +881,7 @@ struct VirtualArray_##func : public hx::Object \
881881
VirtualArray_##func(VirtualArray inThis) : mThis(inThis) { \
882882
HX_OBJ_WB_NEW_MARKED_OBJECT(this); \
883883
} \
884-
String toString() const{ return HX_CSTRING(#func) ; } \
884+
String toString() HXCPP_OVERRIDE { return HX_CSTRING(#func) ; } \
885885
String __ToString() const HXCPP_OVERRIDE { return HX_CSTRING(#func) ; } \
886886
int __GetType() const HXCPP_OVERRIDE { return vtFunction; } \
887887
void *__GetHandle() const HXCPP_OVERRIDE { return mThis.mPtr; } \

src/String.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2348,7 +2348,7 @@ String &String::operator+=(const String &inRHS)
23482348
__String_##func(const String &inThis) : mThis(inThis) { \
23492349
HX_OBJ_WB_NEW_MARKED_OBJECT(this); \
23502350
} \
2351-
String toString() const { return HX_CSTRING(#func); } \
2351+
String toString() HXCPP_OVERRIDE { return HX_CSTRING(#func); } \
23522352
String __ToString() const HXCPP_OVERRIDE { return HX_CSTRING(#func); } \
23532353
int __GetType() const HXCPP_OVERRIDE { return vtFunction; } \
23542354
void *__GetHandle() const HXCPP_OVERRIDE { return const_cast<char *>(mThis.raw_ptr()); } \

0 commit comments

Comments
 (0)