aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Symbols.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-02-25 15:36:30 +0100
committerMartin Odersky <odersky@gmail.com>2014-02-25 15:36:30 +0100
commit6029c748f1dc086d058d6b5fd3d37c04c08318b3 (patch)
treecebc14b1d8ec1812ff658ca754cf1f700b5afda1 /src/dotty/tools/dotc/core/Symbols.scala
parentf0ddc9afbef266d3a8f826b2c4e5249dca88242f (diff)
downloaddotty-6029c748f1dc086d058d6b5fd3d37c04c08318b3.tar.gz
dotty-6029c748f1dc086d058d6b5fd3d37c04c08318b3.tar.bz2
dotty-6029c748f1dc086d058d6b5fd3d37c04c08318b3.zip
Reord of superIds
1) We now keep an association between ClassSymbol and SuperId (instead of TypeRef and SuperId). That's better because superId's are deleted anyway after each run, so we gain nothing by keeping a stable ref. 2) hasChildren got dropped. It was too unreliable. The mere fact that someone take's the superId of a class does not means that that class has children.
Diffstat (limited to 'src/dotty/tools/dotc/core/Symbols.scala')
-rw-r--r--src/dotty/tools/dotc/core/Symbols.scala12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala
index a7e59d356..5bba99c9c 100644
--- a/src/dotty/tools/dotc/core/Symbols.scala
+++ b/src/dotty/tools/dotc/core/Symbols.scala
@@ -480,17 +480,16 @@ object Symbols {
override def superId(implicit ctx: Context): Int = {
val hint = superIdHint
- val key = this.typeRef
- if (hint >= 0 && hint <= ctx.lastSuperId && (ctx.classOfId(hint) eq key))
+ if (hint >= 0 && hint <= ctx.lastSuperId && (ctx.classOfId(hint) eq this))
hint
else {
- val id = ctx.superIdOfClass get key match {
+ val id = ctx.superIdOfClass get this match {
case Some(id) =>
id
case None =>
val id = ctx.nextSuperId
- ctx.superIdOfClass(key) = id
- ctx.classOfId(id) = key
+ ctx.superIdOfClass(this) = id
+ ctx.classOfId(id) = this
id
}
superIdHint = id
@@ -498,9 +497,6 @@ object Symbols {
}
}
- /** Have we seen a subclass of this class? */
- def hasChildren = superIdHint >= 0 // dubious, does not survive runs if children are deleted!
-
override protected def prefixString = "ClassSymbol"
}