aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-10-23 12:34:45 +0200
committerMartin Odersky <odersky@gmail.com>2013-10-23 12:35:57 +0200
commitb94874635483b2864aabd86140e51e7bdd916b40 (patch)
tree0031b7fe6a641814fddbe0ba2f968571441c1411 /src/dotty/tools/dotc/core/SymDenotations.scala
parent70958808202aa27034961aeb3352bd8af2e45312 (diff)
downloaddotty-b94874635483b2864aabd86140e51e7bdd916b40.tar.gz
dotty-b94874635483b2864aabd86140e51e7bdd916b40.tar.bz2
dotty-b94874635483b2864aabd86140e51e7bdd916b40.zip
Caching asSeenFrom on denotations.
The last asSeenFrom on a SingleDenotation is cached. Also, correction of effectiveOwner in SymDenotation, which needs to understand that module classes now end in a "$".
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index 9142e3185..ab58ec3b0 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -258,8 +258,10 @@ object SymDenotations {
initial.asSymDenotation.name startsWith tpnme.ANON_CLASS
/** Is this symbol a package object or its module class? */
- def isPackageObject(implicit ctx: Context): Boolean =
- (name.toTermName == nme.PACKAGEkw) && (owner is Package) && (this is Module)
+ def isPackageObject(implicit ctx: Context): Boolean = {
+ val poName = if (isType) nme.PACKAGE_CLS else nme.PACKAGE
+ (name.toTermName == poName) && (owner is Package) && (this is Module)
+ }
/** Is this symbol an abstract type? */
final def isAbstractType = isType && (this is Deferred)
@@ -956,7 +958,9 @@ object SymDenotations {
} else NoDenotation
override final def findMember(name: Name, pre: Type, excluded: FlagSet)(implicit ctx: Context): Denotation =
- membersNamed(name).filterExcluded(excluded).asSeenFrom(pre).toDenot(pre)
+ //ctx.typeComparer.traceIndented(s"($this).findMember($name, $pre)") { // DEBUG
+ membersNamed(name).filterExcluded(excluded).asSeenFrom(pre).toDenot(pre)
+ //}
private[this] var baseTypeCache: java.util.HashMap[CachedType, Type] = null
private[this] var baseTypeValid: RunId = NoRunId
@@ -1064,7 +1068,7 @@ object SymDenotations {
override def isTerm = false
override def isType = false
override def owner: Symbol = throw new AssertionError("NoDenotation.owner")
- override def asSeenFrom(pre: Type)(implicit ctx: Context): SingleDenotation = this
+ override def computeAsSeenFrom(pre: Type)(implicit ctx: Context): SingleDenotation = this
validFor = Period.allInRun(NoRunId) // will be brought forward automatically
}