Enable processing for all abstracts and typedefs.#291
Enable processing for all abstracts and typedefs.#291EliteMasterEric wants to merge 18 commits intoexperimentalfrom
Conversation
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. |
031118e to
c49099f
Compare
|
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. |
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);
} |
31993ce to
0472b9a
Compare
AbnormalPoof
left a comment
There was a problem hiding this comment.
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?
|
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? |
…exception and crashing if an abstract can't be resolved.
…elds of abstracts)
68d46b7 to
00ed2ef
Compare
…t be resolved at runtime.
|
I rebased and refactored to make sure more abstracts work, the edge case I found that was broken was one where the abstract implementation class was completely optimized out (due to the class having no static functions that Reflect would want to call). I ended up creating a structure that could be returned (to ensure the game doesn't throw an error that the type couldn't be resolved) that then redirects any property retrieval calls to the appropriate place. |
|
Just pushed a fix for calling |
|
Just pushed a commit to fix value assignment, still waiting on nothyper to rebase and update the optimization PR so I can add it. |

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: Terror, 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?