File tree 2 files changed +10
-2
lines changed
compiler/src/dotty/tools/dotc/core 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1680,9 +1680,12 @@ object SymDenotations {
1680
1680
val denots1 = collect(denots, ps)
1681
1681
p.classSymbol.denot match {
1682
1682
case parentd : ClassDenotation =>
1683
+ val parentDenots =
1684
+ // Scala2 compatibility: private types are visible in children, see i5831.scala
1685
+ if (name.isTypeName && ctx.scala2Setting) parentd.membersNamed(name)
1686
+ else parentd.nonPrivateMembersNamed(name)
1683
1687
denots1 union
1684
- parentd.nonPrivateMembersNamed(name)
1685
- .mapInherited(ownDenots, denots1, thisType)
1688
+ parentDenots.mapInherited(ownDenots, denots1, thisType)
1686
1689
case _ =>
1687
1690
denots1
1688
1691
}
Original file line number Diff line number Diff line change
1
+ trait Matchers { matchers =>
2
+ private sealed trait Collected
3
+ def foo (collected : Collected ): Int = 3
4
+ }
5
+ object Matchers extends Matchers
You can’t perform that action at this time.
0 commit comments