vavr-io / vavr

vʌvr (formerly called Javaslang) is a non-commercial, non-profit object-functional library that runs with Java 8+. It aims to reduce the lines of code and increase code quality.
https://vavr.io
Other
5.67k stars 629 forks source link

JDK 21-23 Compatibility for 0.x branch #2811

Open pivovarit opened 1 week ago

pivovarit commented 1 week ago

Branch version/0.x represents a release train for "legacy" vavr and it still needs to be able to be built and verified under the newest JDKs.

At the moment, it collapses under JDK21 with:

(...)
  last tree to typer: EmptyTree
       tree position: <unknown>
            tree tpe: <notype>
              symbol: null
           call site: <none> in <none>

== Source file context for tree position ==

error: scala.reflect.internal.FatalError:
  bad constant pool index: 0 at pos: 48445
     while compiling: <no file>
        during phase: globalPhase=<no phase>, enteringPhase=<some phase>
     library version: version 2.12.6
    compiler version: version 2.12.6
micrommer commented 6 days ago

Hi @pivovarit ,

First of all, I’m really excited to see a new, passionate leader taking charge of the wonderful VAVR!

I compiled using the OpenJDK 64-Bit Server VM Zulu21.32+17-CA (build 21.0.2+13-LTS, mixed mode, sharing) and encountered the same exception. From what I understand, this appears to be an issue with the bytecode.

If you could provide some guidance on how to resolve this issue, I’d be happy to assist.

pivovarit commented 6 days ago

Thanks! Actually, I have no clue what is the core issue here - my bet is that it's caused by outdated dependencies responsible for code generation, or Scala itself (according to scala docs, 2.12.18 is the first JDK21-friendly version)