diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-12 13:38:50 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-03-12 13:38:57 +0100 |
commit | c878f8101173d27fe9640bea5d1cea704061ca3c (patch) | |
tree | e257556f47a3b55fcda6b7984599d36ff83b3fbe /compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala | |
parent | b2d3b8938391516e81f18962e67f5bacf0aa2440 (diff) | |
download | dotty-c878f8101173d27fe9640bea5d1cea704061ca3c.tar.gz dotty-c878f8101173d27fe9640bea5d1cea704061ca3c.tar.bz2 dotty-c878f8101173d27fe9640bea5d1cea704061ca3c.zip |
Fix #2066: Don't qualify private members in SelectionProto's...
... unless they would be accessible in the given context.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala index 17f13d7c1..f67798eaa 100644 --- a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala +++ b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala @@ -95,7 +95,9 @@ object ProtoTypes { override def isMatchedBy(tp1: Type)(implicit ctx: Context) = { name == nme.WILDCARD || { - val mbr = tp1.member(name) + val mbr = + if (tp1.widen.classSymbol.isLinkedWith(ctx.owner.enclosingClass)) tp1.member(name) + else tp1.nonPrivateMember(name) def qualifies(m: SingleDenotation) = memberProto.isRef(defn.UnitClass) || compat.normalizedCompatible(m.info, memberProto) |