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 interface-only traits moved into constructor by Constructors phase #10093

Closed
scabug opened this issue Dec 6, 2016 · 2 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Dec 6, 2016

(Reporting this for reference, to have an issue number. I have a fix already.)

Reported on scala-internals by Georgi Jojgov.

class A[@specialized(Int) T](val value: T) {
  trait B
  def useValue(x:T): Unit = ()
  useValue(value)
}

produces a warning: Class A$B differs only in case from A$B.

The reason is that the trait B is moved into the primary constructor by Constructors, and then copied into the constructor of the specialized subclass. So the class is generated twice in the backend.

@scabug
Copy link
Author

scabug commented Dec 6, 2016

Imported From: https://issues.scala-lang.org/browse/SI-10093?orig=1
Reporter: @lrytz
Affected Versions: 2.12.1

@scabug
Copy link
Author

scabug commented Dec 6, 2016

@lrytz said:
scala/scala#5583

@scabug scabug closed this as completed Dec 21, 2016
@scabug scabug added this to the 2.12.2 milestone Apr 7, 2017
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

2 participants