aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Contexts.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-02-03 12:53:56 +0100
committerMartin Odersky <odersky@gmail.com>2013-02-03 12:53:56 +0100
commit900dca87c35d74a893ab93ff2d73a72bd7fdbb78 (patch)
tree4f5ea4d19a36f4f4e4553f7ec007eb2d7dfc3fc4 /src/dotty/tools/dotc/core/Contexts.scala
parent8ac1b32ad3b190de82f5c4f1d1666f093ad8c20f (diff)
downloaddotty-900dca87c35d74a893ab93ff2d73a72bd7fdbb78.tar.gz
dotty-900dca87c35d74a893ab93ff2d73a72bd7fdbb78.tar.bz2
dotty-900dca87c35d74a893ab93ff2d73a72bd7fdbb78.zip
Making contexts retained in completers condensed to avoid space leaks
Diffstat (limited to 'src/dotty/tools/dotc/core/Contexts.scala')
-rw-r--r--src/dotty/tools/dotc/core/Contexts.scala8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala
index bbc134d7d..8edbec847 100644
--- a/src/dotty/tools/dotc/core/Contexts.scala
+++ b/src/dotty/tools/dotc/core/Contexts.scala
@@ -73,9 +73,15 @@ object Contexts {
newctx
}
+ def condensed: CondensedContext = base.initialCtx.fresh
+ .withPeriod(period)
+ .withPrinter(printer)
+ .withSettings(sstate)
}
- abstract class FreshContext extends Context {
+ abstract class CondensedContext extends Context
+
+ abstract class FreshContext extends CondensedContext {
def withPeriod(period: Period): this.type = { this.period = period; this }
def withPhase(pid: PhaseId): this.type = withPeriod(Period(runId, pid))
def withConstraints(constraints: Constraints): this.type = { this.constraints = constraints; this }