You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inside the same repo, under the directory full contains an actual real-world example (that depends on protobuf-java) that demonstrates this problem and can be used to verify that it is fully fixed.
For completeness, here is the code that reproduces this. It requires JavaThenScala compilation order.
package jpkg;
public class Nested implements NestedBuilder {
public Nested.Nested2.Nested3.Nested4 getNested4() { return null; }
static public class Nested2 {
private Nested2() { }
public static final class Builder2 {
public Nested2 buildPartial() {
return new Nested2();
}
}
static public class Nested3 {
private Nested3() { }
public static final class Builder3 {
public Nested3 buildPartial() {
return new Nested3();
}
}
static public class Nested4 { }
}
}
}
Use.scala:
package spkg;
object Use {
val a: jpkg.Nested = null
}
Compilation error:
[error] /tmp/proto380_scalabug/src/main/scala/Use.scala:4:15: illegal cyclic reference involving class Nested
[error] val a: jpkg.Nested = null
Workarounds would be appreciated as well as this is preventing us from moving forward with ScalaPB to 3.8.0.
The text was updated successfully, but these errors were encountered:
Protobuf-java 3.8.0 was released recently and the code that it generates is not accessible from Scala when nested messages are involved.
The bug that causes this was introduced on Scala 2.12.3 and it exists all the way up to 2.12.8. The bug is not reproducible in Scala 2.13.0.
I created a repo with minimal code that can reproduce this (does not depend on protobuf-java): https://github.com/thesamet/proto380_scalabug
Inside the same repo, under the directory
full
contains an actual real-world example (that depends on protobuf-java) that demonstrates this problem and can be used to verify that it is fully fixed.For completeness, here is the code that reproduces this. It requires
JavaThenScala
compilation order.NestedBuilder.java:
Nested.java:
Use.scala:
Compilation error:
Workarounds would be appreciated as well as this is preventing us from moving forward with ScalaPB to 3.8.0.
The text was updated successfully, but these errors were encountered: