aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-10-21 16:38:27 +0200
committerMartin Odersky <odersky@gmail.com>2014-10-26 16:24:01 +0100
commit04001befb1a7f08da0c38166eed61322104adbaf (patch)
tree1eb21c86a91aaea1c9a5be0583072df4da139ecb /src/dotty/tools/dotc/core/SymDenotations.scala
parente3b0fa2ede56393165759eecd7bc916d24835ee1 (diff)
downloaddotty-04001befb1a7f08da0c38166eed61322104adbaf.tar.gz
dotty-04001befb1a7f08da0c38166eed61322104adbaf.tar.bz2
dotty-04001befb1a7f08da0c38166eed61322104adbaf.zip
Two fixes to avoid scanning package contents
typeParams and outerAccessor both potentially scan all declarations of a class. The fixes make sure this is never done for packages.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index 9a5be70d1..4cc15897c 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -976,7 +976,7 @@ object SymDenotations {
/** The type parameters of this class */
override final def typeParams(implicit ctx: Context): List[TypeSymbol] = {
def computeTypeParams = {
- if (ctx.erasedTypes && (symbol ne defn.ArrayClass)) Nil
+ if (ctx.erasedTypes || is(Module)) Nil // fast return for modules to avoid scanning package decls
else if (this ne initial) initial.asSymDenotation.typeParams
else decls.filter(sym =>
(sym is TypeParam) && sym.owner == symbol).asInstanceOf[List[TypeSymbol]]