-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Cylic reference involving class when using java interop #10567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Milestone
Comments
Self-contained example: // build.sbt
scalaVersion := "3.0.0-M2"
compileOrder := CompileOrder.JavaThenScala // SchemaBuilder.java
public class SchemaBuilder {
public static class Schema {}
public static TypeBuilder<Schema> builder() {
throw new UnsupportedOperationException();
}
public static class NamespacedBuilder<R, S extends NamespacedBuilder<R, S>> {}
public static class FixedBuilder<R> extends NamespacedBuilder<R, FixedBuilder<R>> {}
public static class TypeBuilder<R> {
public FixedBuilder<R> fixed(String name) {
throw new UnsupportedOperationException();
}
}
} // Main.scala
object Test {
val bldr = SchemaBuilder.builder()
val oops = bldr.fixed("foo")
} |
Here is another example from #10623 import org.apache.avro.{ SchemaBuilder, Schema }
import scala.collection.JavaConverters._
def schema = Schema.createRecord("A", "", "",false,
Seq(new Schema.Field("list", SchemaBuilder.array().items(SchemaBuilder.builder.stringType))).asJava
) that results in the same error. |
My temporary workaround is to add a Java file to my project that encapsulates use of the |
@bplommer Had a similar problem. The RC1 seems to solve this. Maybe it will solve it for you too? |
I can still reproduce both problems on master. |
liufengyun
added a commit
to dotty-staging/dotty
that referenced
this issue
Feb 19, 2021
Co-authored-by: Guillaume Martres <[email protected]>
smarter
added a commit
that referenced
this issue
Feb 19, 2021
Fix #10567: avoid forcing symbols in classfile parser
dotbg
pushed a commit
to dotbg/dotty
that referenced
this issue
Feb 24, 2021
Co-authored-by: Guillaume Martres <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Similar to #9492.
I get a compiler error when using Java code from Apache Avro. The specific file is at https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/SchemaBuilder.java
Minimized code
scastie reproduction (3.0.0-M1)
Output with
-Ydebug-error
:Expectation
It should compile
The text was updated successfully, but these errors were encountered: