Skip to content

Commit

Permalink
Merge pull request #4358 from dotty-staging/fix/java-tparams-cycle
Browse files Browse the repository at this point in the history
Fix #4357: Avoid cyclic reference when parsing Java classfile
  • Loading branch information
smarter authored Apr 22, 2018
2 parents f2bb231 + ae2d13a commit 8feb596
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
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()
}

0 comments on commit 8feb596

Please sign in to comment.