-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Compiler version
3.1.2
Minimized code
package deptest {
@deprecated("Not used any more", since="7")
object DeprecatedThing {
val oldValue = 42
}
}
package depuser {
import deptest.DeprecatedThing._
//import deptest.DeprecatedThing
object DepUser {
def main(args: Array[String]): Unit = println {
oldValue
//DeprecatedThing.oldValue // warns
}
}
}
Output
➜ scalac -d /tmp dep.scala
➜ sdk use scala 2.13.8
==== BROADCAST =================================================================
* 2022-06-19: schemacrawler 16.16.18 available on SDKMAN! https://www.schemacrawler.com/changes-report.html
* 2022-06-10: gradle 7.5-rc-2 available on SDKMAN!
* 2022-06-10: scala 2.12.16 available on SDKMAN! https://github.com/scala/scala/releases/tag/v2.12.16
================================================================================
Using scala version 2.13.8 in this shell.
➜ scalac -d /tmp dep.scala
warning: 1 deprecation (since 7); re-run with -deprecation for details
1 warning
➜ scalac -d /tmp -Xlint dep.scala
dep.scala:16: warning: object DeprecatedThing in package deptest is deprecated (since 7): Not used any more
oldValue
^
1 warning
Expectation
Selecting from a deprecated thing should warn, even if an import is implicated. (Edited for clarity.)