Skip to content

[cpp] Do not generate toString in __scriptableFunctions#12375

Merged
Simn merged 5 commits intoHaxeFoundation:developmentfrom
tobil4sk:fix/cpp-scriptable-toString
Sep 30, 2025
Merged

[cpp] Do not generate toString in __scriptableFunctions#12375
Simn merged 5 commits intoHaxeFoundation:developmentfrom
tobil4sk:fix/cpp-scriptable-toString

Conversation

@tobil4sk
Copy link
Copy Markdown
Member

Closes #12374.

Haxe classes do not need to put it in __scriptableFunctions because it is already added by ::hx::Object's:
https://github.com/HaxeFoundation/hxcpp/blob/1618253d7bb2dd8eea1bc7ffcd612452df76a7b7/src/hx/Object.cpp#L123

This allows the vtable mapping generated on lines 972-974 (which already filters out toString) to be consistent with what is generated by cppia from iterating through __scriptableFunctions.

See also #5502.

Test would make more sense in misc, however those are not set up for cppia.

The toString method is filtered out in the vtable mapping on line 973
and is already present in the `__scriptableFunctions` of hx::Object.
We need to filter it out here too to ensure a correct vtable can be
constructed from merging all `__scriptableFunctions` arrays.
Remove unnecessary public modifier

Fix order of expected vs actual equality values
@Aidan63
Copy link
Copy Markdown
Contributor

Aidan63 commented Sep 30, 2025

LGTM

@Simn Simn merged commit 5a1d6f8 into HaxeFoundation:development Sep 30, 2025
47 checks passed
@tobil4sk tobil4sk deleted the fix/cpp-scriptable-toString branch September 30, 2025 13: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.

[cpp] toString in scriptable class breaks vtable of inheriting cppia classes

3 participants