-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Backend ignores NoInits flag, always emit $init$ method on traits #2081
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
Comments
This is not a backend issue, this is due to mixin. |
Could you give some details? |
@smarter, if you run the example you've posted with Generally, in dotty the backend is very dumb. I've tried to move all logic away from it to parts of pipeline that are Y-checked. |
I actually think that the current behavior is correct. |
In both dotty and Scala 2.12 there are no implementation classes. |
apparently for Scala 2.12 adding adding\removing statements in a trait body is binary incompatible. |
@retronym Is the presence/absence of |
@DarkDimius I don't think we should let our design decisions be influenced by binary compatibility at this stage. I still bet on Tasty to fix that. |
@odersky could we discuss this on the next dotty meeting? |
Related: scala/scala-dev#191 |
I tend to think we should always emit the trait constructor unless the trait is marked with |
I've also considered indirecting calls to |
Could you please elaborate why this is better than a call to an empty static method? |
Fix #2081: Don't issue an $init$ method for NoInits traits
Compiled with dotty, then decompiled with cfr:
Compiled with Scala 2.12 then decompiled:
The text was updated successfully, but these errors were encountered: