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
[REJECTED] Nullary override check only current sources #10231
Conversation
Scala 3 does not enforce the override check for Scala 2 definitions. To enable compiling under both regimes, restrict the check to when the overrides are in the current run. Restore the lint option to warn for the remaining cases.
We had the warning since 2.13.3, it seems to me there's no reason to relax it at this point. Was there a discussion already somewhere about aligning Scala 3 instead? |
I see that 2.13 projects can currently just ignore the warning, and they will get an error when they turn on I agree this should be consistent, but I think we can do the stricter version. |
I think an effort to make Scala 3 stricter should come first, and then only if that fails (i.e,, if there's pushback from the Scala 3 folks), should we loosen what we did here in Scala 2. |
The "promotion" for 2.13.3 was imprecise at best. Warning for legal code should be rare. That is what "lint" is for. My example was the pos test, except I was using
Then suddenly my parens error out, but not if I compile with Scala 3. That is not a migration experience. That is deportation from the land of your dreams to embark on a dangerous journey governed by arbitrary rules. |
For the historians, the 2.13.3 PR was @dwijnand's #8846 I guess changing from a warning to a lint is okay, as long as it's included in @som-snytt so your position here is that at the time #8846 was approved and merged, we failed to give sufficient thought to the warning vs lint distinction...? I'm having trouble assembling your remarks into a clear narrative. |
With the caveat that I don't have a passionate take, except to minimize friction for People who want strict checking (without dotty relaxation) should use (The PR doesn't check if the overridden member is Scala 3 under |
TIL it's not quite out-of-the-box.
and
"whilst" |
I fully agree, we need to align with Scala 3, but I vote for enforcing override consistency in the Scala 3 compiler. I think the exception to treat Scala 2 libraries like Java in the Scala 3 compiler was added much earlier, before we had anything on the Scala 2 side. If that doesn't work out, I would demote the error under |
Scala 3 does not enforce the override check for Scala 2 definitions. To enable compiling under both regimes, restrict the check to when the overrides are in the current run. Restore the lint option to warn for the remaining cases.
Fixes scala/bug#12695