aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Denotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-11-14 17:50:10 +0100
committerMartin Odersky <odersky@gmail.com>2013-11-14 18:05:41 +0100
commitffe9e2237956d167b51c9ab1e571a04163b525f7 (patch)
tree952d7177e26997df8761452844df0f375a3aae75 /src/dotty/tools/dotc/core/Denotations.scala
parentfe865cd382bb21026b79070eafa597b865fe461c (diff)
downloaddotty-ffe9e2237956d167b51c9ab1e571a04163b525f7.tar.gz
dotty-ffe9e2237956d167b51c9ab1e571a04163b525f7.tar.bz2
dotty-ffe9e2237956d167b51c9ab1e571a04163b525f7.zip
Some configuation parameters
Caching, plus whether we want to match on signatures or types.
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/Denotations.scala18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala
index 4ab911160..60a4df9fa 100644
--- a/src/dotty/tools/dotc/core/Denotations.scala
+++ b/src/dotty/tools/dotc/core/Denotations.scala
@@ -12,6 +12,7 @@ import Types._, Periods._, Flags._, Transformers._, Decorators._
import printing.Texts._
import printing.Printer
import io.AbstractFile
+import config.Config
import Decorators.SymbolIteratorDecorator
@@ -643,14 +644,15 @@ object Denotations {
type AsSeenFromResult <: PreDenotation
/** The denotation with info(s) as seen from prefix type */
- final def asSeenFrom(pre: Type)(implicit ctx: Context): AsSeenFromResult = {
- if ((cachedPrefix ne pre) || ctx.period != validAsSeenFrom) {
- cachedAsSeenFrom = computeAsSeenFrom(pre)
- cachedPrefix = pre
- validAsSeenFrom = ctx.period
- }
- cachedAsSeenFrom
- }
+ final def asSeenFrom(pre: Type)(implicit ctx: Context): AsSeenFromResult =
+ if (Config.cacheAsSeenFrom) {
+ if ((cachedPrefix ne pre) || ctx.period != validAsSeenFrom) {
+ cachedAsSeenFrom = computeAsSeenFrom(pre)
+ cachedPrefix = pre
+ validAsSeenFrom = ctx.period
+ }
+ cachedAsSeenFrom
+ } else computeAsSeenFrom(pre)
protected def computeAsSeenFrom(pre: Type)(implicit ctx: Context): AsSeenFromResult