Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lua] Improve codegen for handling instance Var functions #10817

Merged
merged 5 commits into from
Jan 3, 2023

Conversation

Frixuu
Copy link
Contributor

@Frixuu Frixuu commented Oct 7, 2022

This PR changes how class instance fields are handled, improving interop with Lua APIs.

  • Var fields that are functions should now behave as "dot methods"
  • assignments to "dot methods" should no longer change their signatures
  • passing as parameters and returning of "dot methods" should no longer wrap them in helper functions
  • non-function members should be left as-is
  • static methods should be left as-is
  • instance methods should be left as-is
  • anonymous structures' fields should be left as-is

Fixes #10799

@Simn
Copy link
Member

Simn commented Oct 8, 2022

Thank you for the contribution! I don't know anything about the Lua target, but this looks quite correct.

Please note that the Lua tests have been disabled since 8027d74 and 3e34d27. I think there was some kind of setup issue which was unresolved, and nobody bothered to fix it. I'm fine with merging this regardless, but it would be good to have this addressed either way so that we can be sure we're not breaking anything with changes like this.

@tobil4sk
Copy link
Member

tobil4sk commented Oct 8, 2022

I think there was some kind of setup issue which was unresolved

Also see #10777

@skial skial mentioned this pull request Oct 12, 2022
1 task
@danielo515
Copy link
Contributor

I will also like to see this merged. What is preventing it?

@Simn
Copy link
Member

Simn commented Jan 3, 2023

I'll merge it even without the tests running. If something breaks, we'll know who to blame!

@Simn Simn merged commit 8d4f2d7 into HaxeFoundation:development Jan 3, 2023
@danielo515
Copy link
Contributor

danielo515 commented Jan 3, 2023 via email

@inklit
Copy link
Contributor

inklit commented Jan 3, 2023

Var fields that are functions should now behave as "dot methods"
thanks! thought I was crazy for this one and was about to submit my own PR for it hah.

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.

[lua] Function assignments to class fields change their signatures (they behave as methods)
5 participants