Skip to content
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

Nested class shadowing in "override" position #117

Closed
eed3si9n opened this issue Mar 6, 2020 · 3 comments
Closed

Nested class shadowing in "override" position #117

eed3si9n opened this issue Mar 6, 2020 · 3 comments

Comments

@eed3si9n
Copy link
Member

eed3si9n commented Mar 6, 2020

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.

@Sciss
Copy link
Contributor

Sciss commented Sep 12, 2020

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.

@SethTisue
Copy link
Member

@Sciss did this end up resolved somehow?

@Sciss
Copy link
Contributor

Sciss commented Nov 17, 2020

Yes, in 2fb8d2e I did what I described above - rename InterfaceMixin in RichWindow to InterfaceMixin2, and make ScrollPane.BarPolicy a case class instead of an Enumeration. When using custom windows, you will get compile errors until you change to InterfaceMixin2 now.

@Sciss Sciss closed this as completed Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants