Scala 3 changed the implementation of lazy vals. Classes containing a lazy val end up with a field called 0bitmap$1:
Compiled from "Test.scala"
public class Test implements scala.Product,java.io.Serializable {
public static final long OFFSET$0;
public long 0bitmap$1;
private final byte a;
...
This results in a ClassFormatError:
Cause: java.lang.ClassFormatError: Illegal field name "0bitmap$1" in class io/altoo/akka/serialization/kryo/TestFieldAccess
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
at com.esotericsoftware.reflectasm.AccessClassLoader.defineClass(AccessClassLoader.java:78)
at com.esotericsoftware.reflectasm.AccessClassLoader.defineAccessClass(AccessClassLoader.java:57)
at com.esotericsoftware.reflectasm.FieldAccess.get(FieldAccess.java:173)
Scala 3 changed the implementation of lazy vals. Classes containing a lazy val end up with a field called
0bitmap$1
:This results in a
ClassFormatError
:(Report from https://github.com/EsotericSoftware/kryo/issues/882)