Skip to content

Conversation

@EliteMasterEric
Copy link
Member

Work in progress to enable processing on every abstract instead of just FlxColor.

Draft because whenever I try to build with this, I get the (unknown position) Type Not Found: T error, which implies it's trying to process a generic type somewhere, but since I don't know what type it's trying to process, I can't resolve the issue.

TODO: Try restricting by package, and see if I can narrow down the culprit that way?

@NotHyper-474
Copy link

I've noticed that explicitly excluding the haxe.display package will instead turn the error into a bunch of these, which looks more promising I guess 🤷
image

Also, while I'm at it, you might wanna remove the trace at line 182 that was added by a previously merged PR.

@EliteMasterEric
Copy link
Member Author

I've noticed that explicitly excluding the haxe.display package will instead turn the error into a bunch of these, which looks more promising I guess 🤷

My initial theory is that these are all enum abstracts, and in the compiled code these values get inline replaced, so we'd have to make a separate implementation to handle them.

@EliteMasterEric EliteMasterEric marked this pull request as ready for review January 31, 2026 11:47
@EliteMasterEric
Copy link
Member Author

The pull request from @lemz1 plus a few additional changes from me have resolved more issues.

You can now access static functions of abstracts, as well as enum values of abstracts.

The only thing you can't really do right now is access instance functions of abstracts, but I'd like to work on that at a future date.

@lemz1
Copy link

lemz1 commented Jan 31, 2026

The only thing you can't really do right now is access instance functions of abstracts, but I'd like to work on that at a future date.

You can still call instance functions like this, although it is a bit hacky

var color = FlxColor.RED;
var rgb = FlxColor.get_rgb(color);

when trying to call instance functions you do it as if it were a static function, the only thing that you have to do additionally is to parse the instance in the first parameter

so a function like this:

function print():Void {
  trace(this);
}

turns into:

static function print(this1):Void {
  trace(this1);
}

@AbnormalPoof AbnormalPoof force-pushed the experimental-abstracts branch from 31993ce to 0472b9a Compare January 31, 2026 21:32
Copy link
Member

@AbnormalPoof AbnormalPoof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This somewhat works, but

  1. You can't import abstract enums
Image 2. Compilation time increases significantly! In Funkin's case it hangs at 100% for around a minute or two

Copy link
Member

@AbnormalPoof AbnormalPoof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importing most abstract enums seems to work now! I'm still wondering about the compiler hanging at 100%... what could it possibly be doing there?

@NotHyper-474
Copy link

Hmm for me the compiler hangs, then its memory usage balloons until it's killed by the system. I can only guess it's something akin to what happened in #226.

Then, perhaps the metadata is also getting populated with too much data and thus, generating code that's too "spaghettified" for some compilers to handle?

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.

5 participants