diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-03-16 00:07:27 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2017-03-16 01:00:38 +0100 |
commit | 1821944511457d6f212b3d577101242ef9e77984 (patch) | |
tree | 6777229c97c9e228d3836562afcb07639b568a89 /compiler/src/dotty/tools/dotc/core/Types.scala | |
parent | 90c1a5f97db02d4af1a6e05f79285c5229f74702 (diff) | |
download | dotty-1821944511457d6f212b3d577101242ef9e77984.tar.gz dotty-1821944511457d6f212b3d577101242ef9e77984.tar.bz2 dotty-1821944511457d6f212b3d577101242ef9e77984.zip |
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.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Types.scala | 11 |
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 |