Sitelet https://github.com/FunkinCrew/polymod/pull/525
Skip to content

[perf/base-class-macro] Skip classes with inline constructors - #525

Merged
AbnormalPoof merged 1 commit into
FunkinCrew:perf/base-class-macrofrom
NotHyper-474:fix/heaps-inline-doodoo
Oct 4, 2026
Merged

AbnormalPoof merged 1 commit into
FunkinCrew:perf/base-class-macrofrom
NotHyper-474:fix/heaps-inline-doodoo

Conversation

@NotHyper-474

Copy link
Copy Markdown
Contributor

This should fix the failure on the Heaps library, as throughout its code lies uses of inlined constructor calls (inline new Foo()) for certain classes.

The fix involves making the macro skip classes that have an inline constructor, as that often means the class itself is stripped away in compile-time and transformed into variables; this does mean that there's a caveat: an enforced inline constructor call could still fail if the class it's trying to inline doesn't have a constructor that in itself is not inline.

Note

I know ClassType has a constructor field. So why not use it, instead of having to use Lambda.find? Apparently since a class has not been fully built when the macro reaches it, the constructor field is always empty, making it useless in this case.

This means the following classes would now be no longer scriptable:

haxe.iterators.StringKeyValueIterator(Unicode)
haxe.iterators.StringIterator(Unicode)
IntIterator
haxe.crypto.Crc32
lime.utils.DataView
lime.system.WorkOutput
lime.system.JobData
flixel.math.FlxBasePoint

These classes are generally used as simple data containers (like Vectors and Matrices)
@NotHyper-474 NotHyper-474 changed the title [perf/base-class-macro] Don't make classes with inline constructors scriptable [perf/base-class-macro] Skip classes with inline constructors Oct 4, 2026
@AbnormalPoof
AbnormalPoof merged commit 021e02f into FunkinCrew:perf/base-class-macro Oct 4, 2026
9 checks passed
@NotHyper-474
NotHyper-474 deleted the fix/heaps-inline-doodoo branch October 4, 2026 11:29
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