-
Notifications
You must be signed in to change notification settings - Fork 21
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
Spurious, positionless overrides-nullary-method warning when extending under separate compilation #12851
Comments
@som-snytt @lrytz You two want to race to see who fixes it first...? History: the warning originally landed in scala/scala#8846 (Scala 2.13.3) and then it was moved from namers to refchecks in scala/scala#10345 (Scala 2.13.11). |
Thanks for the repro! I'll take a look, as I must refresh my memory for |
I'm glad I fixed crasher handling in partest at some point.
|
I thought the same problem might exist for nullary-overrides-nilary ("method without a parameter list overrides a method with a single empty one"), but it doesn't reproduce that way 'round 🤔 |
|
so the second warning started showing up with scala/scala#10484. I think before we only got a single warning because the second one was filtered by the |
The forthcoming PR addresses both when to warn for the override and the position to warn at. (The symbol position should be tree.namePos.) The reason the inverse case ( I haven't looked at the double-warning question yet, but I remember that the "extended explanation" feature (which I remove in a current PR for 2.13.13) had the same problem. That is where a message text could have a "fold line":
where you'd see the long form only once, and only the top half after that. The short form was registered with the filtering reporter. (I think that feature is nicer than If actionable messages may/may not have an addendum, maybe the addendum should be stripped before registration. |
Scala version: 2.13.11
T.scala
C.scala
Reproduction steps
Result
compiling
T.scala
produces a correct warning:but then compiling
C.scala
produces this:we shouldn't be issuing this warning at all IMO, but also note the lack of position information, which means it's difficult to figure out where it's even coming from
Context
This came up over at scala/scala#10484 , where after a recent change for 2.13.12 the attempt to issue the warning actually crashes the compiler.
The text was updated successfully, but these errors were encountered: