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

Ammonite produces class files with missing InnerClasses attribute, leading to Class#getSimpleName crashing with java.lang.IncompatibleClassChangeError #1614

Open
smarter opened this issue Feb 12, 2025 · 0 comments

Comments

@smarter
Copy link
Collaborator

smarter commented Feb 12, 2025

This only happens with Scala 3, so it could be an issue in the Scala 3 compiler, but I haven't been able to reproduce it outside of ammonite, so it might be that ammonite is doing something weird, although looking at the code of ammonite I haven't been able to pinpoint what exactly:

Welcome to the Ammonite Repl 3.0.1 (Scala 3.6.3 Java 21.0.6)
@ class Bar(); println((new Bar()).getClass.getSimpleName)
java.lang.IncompatibleClassChangeError: ammonite.$sess.cmd0 and ammonite.$sess.cmd0$Bar disagree on InnerClasses attribute
  java.lang.Class.getDeclaringClass0(Native Method)
  java.lang.Class.isTopLevelClass(Class.java:1971)
  java.lang.Class.getSimpleBinaryName(Class.java:1956)
  java.lang.Class.getSimpleName0(Class.java:1793)
  java.lang.Class.getSimpleName(Class.java:1784)
  ammonite.$sess.cmd0$.<clinit>(cmd0.sc:1)
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

1 participant