IncompatibleClassChangeError on inner class java.lang.Class
See original GitHub issueobject Test {
def main(args: Array[String]): Unit = {
class Foo
classOf[Foo].getDeclaringClass
}
}
fails with
Exception in thread "main" java.lang.IncompatibleClassChangeError: Test and Test$Foo$1 disagree on InnerClasses attribute
at java.lang.Class.getDeclaringClass0(Native Method)
at java.lang.Class.getDeclaringClass(Class.java:1235)
at Test$.main(Foo.scala:4)
at Test.main(Foo.scala)
It works on scalac
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top Results From Across the Web
What causes java.lang.IncompatibleClassChangeError?
This means that you have made some incompatible binary changes to the library without recompiling the client code. Java Language Specification §13 details ......
Read more >[class] and [inner class] disagree on InnerClasses attribute
java.lang.IncompatibleClassChangeError: [class] and [inner class] disagree on InnerClasses ... InnerClasses attribute (NO_SOURCE_FILE:0) [Thrown class
Read more >INCOMPATIBLECLASSCHANGE...
IncompatibleClassChangeError : incompatible InnerClasses attribute between "anyPackage.anyClass$InnerClass" and "anyPackage.anyClass"at java.lang.Class.
Read more >Class IncompatibleClassChangeError - developer.classpath.org!
An IncompatibleClassChangeError is thrown when the definition of a class used by the currently executing method has changed in an incompatible way.
Read more >IncompatibleClassChangeError (Java Platform SE 8 )
public class IncompatibleClassChangeError extends LinkageError. Thrown when an incompatible class change has occurred to some class definition.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you wish to try it out early, the fix should be part of the latest nightly: https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3.0.0-RC2/3.0.0-RC2-bin-20210310-4af1386-NIGHTLY/
Awesome! Looking forward to test dotty native image compatibility once 3.0.0-RC2 is out