aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-12 13:38:50 +0100
committerMartin Odersky <odersky@gmail.com>2017-03-12 13:38:57 +0100
commitc878f8101173d27fe9640bea5d1cea704061ca3c (patch)
treee257556f47a3b55fcda6b7984599d36ff83b3fbe /compiler/src/dotty/tools/dotc/core/SymDenotations.scala
parentb2d3b8938391516e81f18962e67f5bacf0aa2440 (diff)
downloaddotty-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/core/SymDenotations.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/core/SymDenotations.scala4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala
index c98b444d9..326f0e39e 100644
--- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -957,6 +957,10 @@ object SymDenotations {
else
companionNamed(name)(ctx.outersIterator.dropWhile(_.scope eq ctx.scope).next)
+ /** Is this symbol the same or a linked class of `sym`? */
+ final def isLinkedWith(sym: Symbol)(implicit ctx: Context): Boolean =
+ (symbol eq sym) || (linkedClass eq sym)
+
/** If this is a class, the module class of its companion object.
* If this is a module class, its companion class.
* NoSymbol otherwise.