Skip to content

Commit 8d8b5b9

Browse files
authored
Allow private members when computing the denotation of a NamedType (#22549)
Closes #22548
2 parents 47881da + 6d00305 commit 8d8b5b9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -2473,7 +2473,7 @@ object Types extends TypeUtils {
24732473
else lastd match {
24742474
case lastd: SymDenotation =>
24752475
if stillValid(lastd) && checkedPeriod.code != NowhereCode then finish(lastd.current)
2476-
else finish(memberDenot(lastd.initial.name, allowPrivate = false))
2476+
else finish(memberDenot(lastd.initial.name, allowPrivate = lastd.is(Private)))
24772477
case _ =>
24782478
fromDesignator
24792479
}

tests/pos/i22548.scala

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
trait Bar[T]
2+
class Foo[T <: Bar[T]] (private val buffer: Any) extends AnyVal

0 commit comments

Comments
 (0)