-
Notifications
You must be signed in to change notification settings - Fork 21
Scala 2.13.12 fatal warning with -Xsource:3 and private constructor for case class #12883
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
FYI, also reported here: https://discord.com/channels/632150470000902164/632150470000902166/1150748646296518707 |
You can also use a compiler flag |
Sure, this is better than polluting code with |
I don't think it's a bug; the main use case of But I understand that many projects keep |
Looks like warning is confusing because it is not clear how this code is handled differently between Scala 2 and 3. Is it possible to add some documentation? |
You're right, "constructor modifiers are assumed by synthetic
I also notice that Scala 2 changes semantics for this example with Documenting Maybe we can also find ways have better defaults. For example focus |
That's one of the main reasons I enable |
This is also on my radar since seeing it in std lib scala/scala#10551
The synthetic apply warning is significant for libraries that must plan around compatibility. I agree there is no great solution, which attests to the severity of the breaking change between the compilers. I'll try to propose something; maybe another knob. I noticed the warning about apply is incorrect when user has supplied one, because of an implementation detail. That is a separate bug. Edit: the change in inference of type of overriding method is an obvious example of behavior change that I think is a win, but also requires a code change if you prefer the old inferred type; and is annoying because it requires Oh, maybe |
I will try Lukas's idea of the regular option to warn and the x-tended option to apply new behaviors. Maybe it will make it into 2.13.13 on Friday the 13th. I'll try to document the situation, but I will likely underdeliver, as I am no sjrd. I'll sample the canine cuisine on the stdlib PR. Edit: current help for
Obviously, the accommodation is to only warn under |
Sample improved message
|
Reproduction steps
Scala version: 2.13.12
Problem
Same warning is for synthetic
apply
method. This cannot be fixed without redefiningcopy
andapply
explicitly and doesn't help with any Scala 3 migration issue. In all cases I have to suppress it with@nowarn
The text was updated successfully, but these errors were encountered: