Closed n3f4s closed 2 years ago
Workaround: add a dependency on immutables:
diff --git build.sbt build.sbt
index 0fddd4b..0c3ad48 100644
--- build.sbt
+++ build.sbt
@@ -11,6 +11,7 @@ lazy val app = project
resolvers += "d4j-snapshot" at "https://oss.sonatype.org/content/repositories/snapshots",
libraryDependencies ++= Seq(
"com.discord4j" % "discord4j-core" % "3.2.0-SNAPSHOT",
+ "org.immutables" % "value" % "2.8.2"
),
name := "Test bot",
The ClassfileParser should ignore annotations without classfiles instead of crashing, just like scala 2 and java do.
https://github.com/lampepfl/dotty/commit/6f32b6299833fd23868fca9c00ee14ed6cb1158c should have fixed this but wasn't enough to deal with inner classes apparently.
A self-contained example:
Value.java
public @interface Value {
@interface Immutable {}
}
@Value.Immutable
abstract class Baz {}
Test.scala
object Test {
def baz: Baz = ???
}
$ javac Value.java
$ rm Value*.class
$ scalac -3.head Test.scala
Bad symbolic reference. A signature
refers to Value/T in package <empty> which is not available.
It may be completely missing from the current classpath, or the version on
the classpath might be incompatible with the version used when compiling the signature.
Caught: java.lang.AssertionError: assertion failed: failure to resolve inner class:
externalName = Value$Immutable,
outerName = Value,
innerName = Immutable
owner.fullName = Value
while parsing ./Baz.class while parsing annotations in ./Baz.class
1 warning found
1 error found
$ scalac -213 Test.scala // succeeds
This issue was picked for the Issue Spree 15 of May 3rd which takes place a week from now. @SethTisue, @griggt and @jodersky will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.
Compiler version
Compiler version: 3.1.0-RC1
Minimized code
Output
Expectation
The code compiles (and run as expected) with the
Scala 2
compiler but give me this error message when compiling with theScala 3
compiler.The full code and
sbt
build file can be found here: https://github.com/n3f4s/scala3D4j3.2ErrorMWE