aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
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.