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

Invalid class file with case class and trait in method (duplicate field name&signature) #8984

Closed
scabug opened this issue Nov 15, 2014 · 3 comments

Comments

@scabug
Copy link

scabug commented Nov 15, 2014

The following code compiles but throws an exception at runtime:
Exception in thread "main" java.lang.ClassFormatError: Duplicate field name&signature in class file Test$C$2

object Test extends App {
  
  test()
  
  def test () {
    
    val a = 42
    
    trait T {
      def f { a }
    }
    
    case class C () extends T
    
    C()
    
  }
  
}
@scabug
Copy link
Author

scabug commented Nov 15, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8984?orig=1
Reporter: Lionel Parreaux (LPTK)
Affected Versions: 2.10.4, 2.11.2, 2.12.0
See #5252

@scabug
Copy link
Author

scabug commented Sep 26, 2016

@lrytz said:
In 2.12.0-RC1, there's a compile-time error: error: parameter 'a$1' requires field but conflicts with value a$1 in trait T$1

Possibly a duplicate of #5252, at least related.

@scabug
Copy link
Author

scabug commented Nov 11, 2016

@SethTisue said:
Seems to me we could just close this as a duplicate of #5252, though it's valuable to have the additional test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants