Nested class shadowing in "override" position
eed3si9n opened this issue · 3 comments
Aloha. This is a friendly note that Community Builds has discovered a potential issue you might run into when migrating to Dotty / Scala 3.x.
Ref scala/scala#8705 / scala/bug#8353
steps
Compile using the latest 2.13.x nightly (https://scala-ci.typesafe.com/job/scala-2.13.x-integrate-community-build/3267/) or 2.13.2 when it comes out.
sbt> set ThisBuild/resolvers += "scala-integration" at "https://scala-ci.typesafe.com/artifactory/scala-integration/"
sbt> ++2.13.2-bin-53ba87a!
sbt> compile
problem
Community Builds discovered there are some nested classes in "override" position.
[scala-swing] [warn] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.16/project-builds/scala-swing-c3658cc87953fc195bdf67bc22f02da415303e04/src/main/scala/scala/swing/RichWindow.scala:42:9: shadowing a nested class of a parent is deprecated but trait InterfaceMixin shadows trait InterfaceMixin defined in class Window; rename the class to something else
[scala-swing] [warn] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.16/project-builds/scala-swing-c3658cc87953fc195bdf67bc22f02da415303e04/src/main/scala/scala/swing/ScrollPane.scala:35:11: shadowing a nested class of a parent is deprecated but class Value shadows class Value defined in class Enumeration; rename the class to something else
expectation
Nothing for now, but consider renaming them when you can.
it turns out both cases produce compile errors with dotty, so they will have to be fixed in any case. My WIP solution is to rename InterfaceMixin
in RichWindow
to InterfaceMixin2
, and make ScrollPane.BarPolicy
a case class instead of an Enumeration
.