Skip to content

Commit 11a3d0d

Browse files
committed
Replacing Symbol forwarders by two implicits from Symbol to SymDenotation/ClassDenotation. Rearrangement of SymDenotation methods
1 parent b9fa2c9 commit 11a3d0d

File tree

3 files changed

+373
-442
lines changed

3 files changed

+373
-442
lines changed

src/dotty/tools/dotc/core/Denotations.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ object Denotations {
132132
def isType: Boolean
133133

134134
/** Is this a reference to a term symbol? */
135-
final def isTerm: Boolean = !isType
135+
def isTerm: Boolean = !isType
136136

137137
/** Is this denotation overloaded? */
138138
def isOverloaded = isInstanceOf[MultiDenotation]
@@ -253,7 +253,7 @@ object Denotations {
253253
}
254254

255255
abstract class SingleDenotation extends Denotation with DenotationSet {
256-
final override def isType = info.isInstanceOf[TypeType]
256+
override def isType = info.isInstanceOf[TypeType]
257257
override def signature: Signature = {
258258
def sig(tp: Type): Signature = tp match {
259259
case tp: PolyType =>
@@ -268,9 +268,9 @@ object Denotations {
268268
}
269269

270270
def derivedSingleDenotation(s: Symbol, i: Type): SingleDenotation =
271-
if ((s eq symbol) && (i eq info)) this else copy(s, i)
271+
if ((s eq symbol) && (i eq info)) this else newLikeThis(s, i)
272272

273-
protected def copy(s: Symbol, i: Type): SingleDenotation = this
273+
protected def newLikeThis(s: Symbol, i: Type): SingleDenotation = this
274274

275275
def orElse(that: => SingleDenotation) = if (this.exists) this else that
276276

@@ -372,14 +372,14 @@ object Denotations {
372372
val info: Type,
373373
initValidFor: Period) extends SingleDenotation {
374374
validFor = initValidFor
375-
override protected def copy(s: Symbol, i: Type): SingleDenotation = new UniqueRefDenotation(s, i, validFor)
375+
override protected def newLikeThis(s: Symbol, i: Type): SingleDenotation = new UniqueRefDenotation(s, i, validFor)
376376
}
377377

378378
class JointRefDenotation(val symbol: Symbol,
379379
val info: Type,
380380
initValidFor: Period) extends SingleDenotation {
381381
validFor = initValidFor
382-
override protected def copy(s: Symbol, i: Type): SingleDenotation = new JointRefDenotation(s, i, validFor)
382+
override protected def newLikeThis(s: Symbol, i: Type): SingleDenotation = new JointRefDenotation(s, i, validFor)
383383
}
384384

385385
class ErrorDenotation(implicit ctx: Context) extends SingleDenotation {

0 commit comments

Comments
 (0)