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
ClassFormatError: Duplicate field name&signature on val in trait and subclass #7645
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7645?orig=1 |
@paulp said: private final int x;
private final int T$$x; The class should verify that its private members don't share a name with inherited ones. |
Claudio Bley (cb) said (edited on Mar 13, 2014 2:43:53 PM UTC): {code:java|borderStyle=solid} def foo(): Unit = { trait T { def construct = new Example with T { |
Matthias Langer (mlangc) said: object Bug {
def main(args: Array[String]): Unit = {
sealed trait Step {
def back: Step = this match {
case StepDown => StepBack(0)
case StepBack(level) => StepBack(level + 1)
}
def targetSize(originalSize: Int): Int = this match {
case StepDown => originalSize/2
case StepBack(level) =>
val baseLevel = {
if (level == 0) StepDown.targetSize(originalSize)
else StepBack(level-1).targetSize(originalSize)
}
val gap = (originalSize - baseLevel)
baseLevel + gap/2
}
def isExhausted(originalSize: Int): Boolean = {
targetSize(originalSize) == originalSize - 1
}
}
case object StepDown extends Step
case class StepBack(level: Int) extends Step
println(StepDown.back)
}
} |
@SethTisue said: |
The compiler accepts the following code, but it fails at runtime with:
Exception in thread "main" java.lang.ClassFormatError: Duplicate field name&signature in class file Cl
The text was updated successfully, but these errors were encountered: