aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/dotty/tools')
-rw-r--r--compiler/src/dotty/tools/dotc/core/Types.scala11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala
index c88342e12..fa1b6dda6 100644
--- a/compiler/src/dotty/tools/dotc/core/Types.scala
+++ b/compiler/src/dotty/tools/dotc/core/Types.scala
@@ -1585,11 +1585,12 @@ object Types {
protected def asMemberOf(prefix: Type)(implicit ctx: Context): Denotation =
if (name.isShadowedName) prefix.nonPrivateMember(name.revertShadowed)
- else {
- val d = lastDenotation
- // Never go from a non-private denotation to a private one
- if (d == null || d.symbol.is(Private)) prefix.member(name)
- else prefix.nonPrivateMember(name)
+ else lastDenotation match {
+ case d: SymDenotation if !d.is(Private) =>
+ // We shouldn't go from a non-private denotation to a private one
+ prefix.nonPrivateMember(name)
+ case _ =>
+ prefix.member(name)
}
/** (1) Reduce a type-ref `W # X` or `W { ... } # U`, where `W` is a wildcard type