From 11a3d0d2792689d4992bef6dd0887dd5e8a08cb5 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 7 Feb 2013 13:37:57 +0100 Subject: Replacing Symbol forwarders by two implicits from Symbol to SymDenotation/ClassDenotation. Rearrangement of SymDenotation methods --- src/dotty/tools/dotc/core/Denotations.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/dotty/tools/dotc/core/Denotations.scala') diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index f43fe5121..2c977f4be 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -132,7 +132,7 @@ object Denotations { def isType: Boolean /** Is this a reference to a term symbol? */ - final def isTerm: Boolean = !isType + def isTerm: Boolean = !isType /** Is this denotation overloaded? */ def isOverloaded = isInstanceOf[MultiDenotation] @@ -253,7 +253,7 @@ object Denotations { } abstract class SingleDenotation extends Denotation with DenotationSet { - final override def isType = info.isInstanceOf[TypeType] + override def isType = info.isInstanceOf[TypeType] override def signature: Signature = { def sig(tp: Type): Signature = tp match { case tp: PolyType => @@ -268,9 +268,9 @@ object Denotations { } def derivedSingleDenotation(s: Symbol, i: Type): SingleDenotation = - if ((s eq symbol) && (i eq info)) this else copy(s, i) + if ((s eq symbol) && (i eq info)) this else newLikeThis(s, i) - protected def copy(s: Symbol, i: Type): SingleDenotation = this + protected def newLikeThis(s: Symbol, i: Type): SingleDenotation = this def orElse(that: => SingleDenotation) = if (this.exists) this else that @@ -372,14 +372,14 @@ object Denotations { val info: Type, initValidFor: Period) extends SingleDenotation { validFor = initValidFor - override protected def copy(s: Symbol, i: Type): SingleDenotation = new UniqueRefDenotation(s, i, validFor) + override protected def newLikeThis(s: Symbol, i: Type): SingleDenotation = new UniqueRefDenotation(s, i, validFor) } class JointRefDenotation(val symbol: Symbol, val info: Type, initValidFor: Period) extends SingleDenotation { validFor = initValidFor - override protected def copy(s: Symbol, i: Type): SingleDenotation = new JointRefDenotation(s, i, validFor) + override protected def newLikeThis(s: Symbol, i: Type): SingleDenotation = new JointRefDenotation(s, i, validFor) } class ErrorDenotation(implicit ctx: Context) extends SingleDenotation { -- cgit v1.2.3