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
scalac warns about deprecated use of identifier "then" even if it is marked as deprecated #5715
Comments
Imported From: https://issues.scala-lang.org/browse/SI-5715?orig=1 |
@paulp said: |
Warnings about reserved words are given in the lexical analysis stage( Isn't it enough to issue warnings at the time of identifier declaration? package example
class then
object Foo {
val t = new then
}
With the release of Scala3, reserved words have already been fixed, and reserved words other than Therefore, it would be better to remove the warning about future reserved words in the lexical analysis stage, and change it to warn against reserved words other than then, which were added in Scala3, only when declaring identifiers. |
agree; I would be in favor of merging a PR that did only that and as a separate matter, if new warnings are added, I'd suggest putting those warnings behind |
It could be done via the much-abused "extra units of work" that run after typer. Edit: I had a branch from 2019 that started down that path. |
should be
that is, if we were still using These warnings already go through Normally, For the definition, typer could clear buffered deprecations in range of the deprecated definition. |
The future keywords warning was at scala/scala#9722. My first take removed the current warning at scanner, added the usage warning in refchecks (check the name when the ref is checked) and the definition site warning piggy-backing on the future keywords warning in parser. My second take piggybacks on The hard part on first take was figuring out who was stripping the |
In the following source code
scalac complains that
This is not usually the case when using deprecated API. If the caller is also deprecated, no warning should be emitted.
The text was updated successfully, but these errors were encountered: