Skip to content
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
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/typer/Typer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ class Typer extends Namer
if !curOwner.is(Package) || isDefinedInCurrentUnit(defDenot) then
result = checkNewOrShadowed(found, Definition) // no need to go further out, we found highest prec entry
found match
case found: NamedType if curOwner.isClass && isInherited(found.denot) =>
case found: NamedType
if curOwner.isClass && isInherited(found.denot) && !ctx.compilationUnit.isJava =>
checkNoOuterDefs(found.denot, ctx, ctx)
case _ =>
else
Expand Down
7 changes: 7 additions & 0 deletions tests/pos/i13106.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
final class A {
public static final class C { }
public static final class D {
public static final class C { }
public C foo() { return new C(); }
}
}