Closed arixmkii closed 1 year ago
And I just joked that "adding strings" was the only API I never need to consult the docs about.
https://github.com/scala/scala/pull/10184 is the version bump
but why is it reading class files under --release
?
at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository.parseClass(ByteCodeRepository.scala:295)
at scala.tools.nsc.backend.jvm.analysis.BackendUtils.collectNestedClasses(BackendUtils.scala:422)
at scala.tools.nsc.backend.jvm.PostProcessor.setInnerClasses(PostProcessor.scala:136)
PARSE CLASS(java.lang.invoke.MethodHandles$Lookup) // bit of debug
PARSE CLASS(java.lang.invoke.MethodHandles)
The successful compile outputs
1: invokedynamic #27, 0 // InvokeDynamic #0:makeConcatWithConstants:(Ljava/lang/String;)Ljava/lang/String;
InnerClasses:
public static final #13= #10 of #12; // Lookup=class java/lang/invoke/MethodHandles$Lookup of class java/lang/invoke/MethodHandles
This might have been a use case for --release:11 --target:8
except that does not work around it.
// `StringConcatFactory` only got added in JDK 9, so use `StringBuilder` for lower
if (classfileVersion.get < asm.Opcodes.V9) {
because brilliantly
def targetValue: String = releaseValue.getOrElse(target.value)
nice catch, and good timing!
Reproduction steps
Scala version: 2.13.10
Problem
When trying to compile on JDK 20:
Compiles just fine with Temuring 17 JDK.
Platforms tested on: