Early Java pickling (using -Ypickle-java) fails with static self-imports. Given C.java:
import static C.*;
import java.util.*;
public class C {}
$ ~/scala/scala-2.13.10/bin/scalac -Ypickle-java -Ypickle-write c-pickle.jar -d c.jar C.java
C.java:2: error: encountered unrecoverable cycle resolving import.
Note: this is often due in part to a class depending on a definition nested within its companion.
If applicable, you may wish to try moving some members into another object.
import java.util.*;
^
C.java:3: error: illegal cyclic reference involving class C
public class C {}
^
2 errors
The first error is a follow-on triggered by import java.util.*;. It only occurs together with the original error triggered by import static C.*;. I encountered this originally in 2.12.15 and it is reproducible in 2.13.10. The file compiles correctly without -Ypickle-java.
Early Java pickling (using
-Ypickle-java
) fails with static self-imports. GivenC.java
:The first error is a follow-on triggered by
import java.util.*;
. It only occurs together with the original error triggered byimport static C.*;
. I encountered this originally in 2.12.15 and it is reproducible in 2.13.10. The file compiles correctly without-Ypickle-java
.