aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-11-26 17:08:58 +0100
committerMartin Odersky <odersky@gmail.com>2013-11-26 17:08:58 +0100
commitf0b4fc58e0c5e5372c23bd817954ed3aa82b2102 (patch)
tree7d933db35e8d3c975b69089312b72397842575c0 /src/dotty/tools/dotc/core/Types.scala
parent537e29676b0706de1855fe763b87732b846931f4 (diff)
downloaddotty-f0b4fc58e0c5e5372c23bd817954ed3aa82b2102.tar.gz
dotty-f0b4fc58e0c5e5372c23bd817954ed3aa82b2102.tar.bz2
dotty-f0b4fc58e0c5e5372c23bd817954ed3aa82b2102.zip
More posishings of SymDenots/Denotations.
In particular - closed a loophole where we did not go through parentDenot in ClassDenotation. - fused some of the predenotation ops used in computeMemberNames
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 437839c4f..9c849bfdf 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -1708,7 +1708,7 @@ object Types {
abstract case class ClassInfo(
prefix: Type,
cls: ClassSymbol,
- classParents: List[TypeRef],
+ myClassParents: List[TypeRef], // to be used only in ClassDenotation!
decls: Scope,
selfInfo: DotClass /* should be: Type | Symbol */) extends CachedGroundType with TypeType {
@@ -1738,16 +1738,16 @@ object Types {
override def parents(implicit ctx: Context): List[TypeRef] = {
if (parentsCache == null)
- parentsCache = classParents.mapConserve(rebase(_).asInstanceOf[TypeRef])
+ parentsCache = cls.classParents.mapConserve(rebase(_).asInstanceOf[TypeRef])
parentsCache
}
def derivedClassInfo(prefix: Type)(implicit ctx: Context) =
if (prefix eq this.prefix) this
- else ClassInfo(prefix, cls, classParents, decls, selfInfo)
+ else ClassInfo(prefix, cls, myClassParents, decls, selfInfo)
- def derivedClassInfo(prefix: Type, classParents: List[TypeRef], selfInfo: Type)(implicit ctx: Context) =
- if ((prefix eq this.prefix) && (classParents eq this.classParents) && (selfInfo eq this.selfInfo)) this
+ def derivedClassInfo(prefix: Type = this.prefix, classParents: List[TypeRef] = myClassParents, selfInfo: DotClass = this.selfInfo)(implicit ctx: Context) =
+ if ((prefix eq this.prefix) && (classParents eq this.myClassParents) && (selfInfo eq this.selfInfo)) this
else ClassInfo(prefix, cls, classParents, decls, selfInfo)
override def computeHash = doHash(cls, prefix)