question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IncompatibleClassChangeError on inner class java.lang.Class

See original GitHub issue
object 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
smartercommented, Mar 11, 2021

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/

0reactions
farquetcommented, Mar 10, 2021

Awesome! Looking forward to test dotty native image compatibility once 3.0.0-RC2 is out

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found