Skip to content

Commit 1821944

Browse files
committed
Don't force denotations in asMemberOf
This was introduced in the previous commit and caused unpickling failures, we are now more conservative and only check the Private flag on SymDenotations so we don't have to load any other denotation.
1 parent 90c1a5f commit 1821944

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,11 +1585,12 @@ object Types {
15851585

15861586
protected def asMemberOf(prefix: Type)(implicit ctx: Context): Denotation =
15871587
if (name.isShadowedName) prefix.nonPrivateMember(name.revertShadowed)
1588-
else {
1589-
val d = lastDenotation
1590-
// Never go from a non-private denotation to a private one
1591-
if (d == null || d.symbol.is(Private)) prefix.member(name)
1592-
else prefix.nonPrivateMember(name)
1588+
else lastDenotation match {
1589+
case d: SymDenotation if !d.is(Private) =>
1590+
// We shouldn't go from a non-private denotation to a private one
1591+
prefix.nonPrivateMember(name)
1592+
case _ =>
1593+
prefix.member(name)
15931594
}
15941595

15951596
/** (1) Reduce a type-ref `W # X` or `W { ... } # U`, where `W` is a wildcard type

0 commit comments

Comments
 (0)