Skip to content
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

Fix #4357: Avoid cyclic reference when parsing Java classfile #4358

Merged
merged 1 commit into from
Apr 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/SymDenotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ object SymDenotations {
*/
private def companionNamed(name: TypeName)(implicit ctx: Context): Symbol =
if (owner.isClass)
owner.info.decl(name).suchThat(_.isCoDefinedWith(symbol)).symbol
owner.unforcedDecls.lookup(name).suchThat(_.isCoDefinedWith(symbol)).symbol
else if (!owner.exists || ctx.compilationUnit == null)
NoSymbol
else if (!ctx.compilationUnit.tpdTree.isEmpty)
Expand Down
4 changes: 4 additions & 0 deletions tests/pos-java-interop/i4357/B_1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public class B_1 extends A<B_1.C> {
public static class C {};
}
class A<T> {}
3 changes: 3 additions & 0 deletions tests/pos-java-interop/i4357/Test_2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
object Test {
val b: B_1 = new B_1()
}