-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
"Reference to X is ambiguous" compiling Java code #13106
Comments
I can take a look at this |
See scala/scala#5332 and scala/scala#7671 for fixes in this area in scala/scala. At some point in the past, I think the strategy was to represent a Java class
using an import
but we changed this and now there is a java-specific lookup method |
No we actually ported that change: #12884 |
Ah, OK. The imports seem to be there after parsing though: public final class A {
public static final class C { }
public static final class D {
public static final class C { }
public C foo() { return new C(); }
}
} object Test {
def foo: A.D.C = (new A.D).foo()
}
|
I don't see them on master, so I assume you're using an older compiler. |
Allright, I tried 3.0.1 |
3.0.1 was branched more than six weeks ago so it's old news already ;) |
sdkman is out of the loop.
|
The Akka codebase includes some Java code resulting from code generation using
protoc
from.protobuf
files. This Java code is kept under SCM (git) so it is not regenerated over and over.A particular protobuf file uses protobuf inner messages that result into generating inner classes when producing Java classes for the protobuf messages. Each of the generated classes includes a
Builder
inner class.Compiling code that uses those
Builder
classes produces the following compiler error:when compiling this code.
NOTE: this error is a sample, there are a few more identical to that one.
I already tried compiling java sources first as suggested offline by some colleagues (@lrytz) but that workaround is not feasible in this particular codebase, unfortunately, since there are other parts of the build that require compiling Scala first. Using
Mixed
compile ordering doesn't work around the issue.Compiler version
3.0.1-RC1
Minimized code
Or probably smaller:
Expectation
The compile can compile the Java code as it did in 2.13 and previous versions.
The text was updated successfully, but these errors were encountered: