Skip to content

[cpp] Mark overridden scriptable methods#12413

Merged
Simn merged 4 commits intoHaxeFoundation:developmentfrom
tobil4sk:fix/cpp-scriptable-mark-overrides
Dec 27, 2025
Merged

[cpp] Mark overridden scriptable methods#12413
Simn merged 4 commits intoHaxeFoundation:developmentfrom
tobil4sk:fix/cpp-scriptable-mark-overrides

Conversation

@tobil4sk
Copy link
Member

#12375 and #12377 reintroduced a bug with super.method calls: HaxeFoundation/hxcpp#1150

This provides an alternative solution to the original issues: #12374 #12376 (and I suppose #5502), by marking methods as overrides so that the cppia runtime can ignore them when constructing the vtable, but still access them for resolving super.method calls (as done in #11773). This requires support from the hxcpp side: HaxeFoundation/hxcpp#1273.

This solves the issue while preserving the fix from #11773. I have added a test here for HaxeFoundation/hxcpp#1150 to avoid further regressions.

See also: #12376 (comment)

Rather than omitting method overrides, we now include them but mark them
as overrides to prevent them from being added as separate slots in the
vtable. This keeps vtable indices working correctly while keeping
super.method calls working as they should.
It is not needed as it is always defined the same way by hxcpp. We can
instead just pass the argument directly, or omit it if it is empty.

In some cases, HXCPP_CPPIA_SUPER_ARG(0) was being passed to the
inIsStatic argument.
They are optional in the api version of hxcpp we require, and have been
optional for a very long time.
@tobil4sk tobil4sk force-pushed the fix/cpp-scriptable-mark-overrides branch from 6db1046 to 83d61b9 Compare December 27, 2025 09:20
@tobil4sk
Copy link
Member Author

With the hxcpp side merged: HaxeFoundation/hxcpp#1273, this is now passing.

@Simn Simn merged commit fa0e459 into HaxeFoundation:development Dec 27, 2025
49 checks passed
@tobil4sk tobil4sk deleted the fix/cpp-scriptable-mark-overrides branch December 27, 2025 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants