-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Scala.js trait super call code generation #7962
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, and thank you for opening this PR! 🎉
All contributors have signed the CLA, thank you! ❤️
Have an awesome day! ☀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, and sorry for the delay. Here are a few comments. The overall idea looks sound.
@sjrd Hello! After getting more understanding of the compiler code, I got an alternative fix, which is smaller code change, although it adds one more bit of code path difference between JVM and js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. The new fix looks good.
Could you address the two whitespace-related comments below, then squash everything together in one commit, please? Given that the strategy has been completely replaced, it makes no sense to keep in the intermediate commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
In this commit scala.js will not rewrite super calls into scala2x traits to static methods. so
<init>
trait constructors is not rewritten, but although they are non-static in scala2x, they are actually named$init$
.Alternative fix will be changing
encodeMethodSym
(I only thought of this alternative afterwards, not sure it works actually), not sure which one is preferred...