summaryrefslogtreecommitdiff
path: root/test/files/presentation
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-11-12 14:18:52 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-11-12 15:29:53 -0800
commited37907d4fe426ba804fee9d6c7c4062ae4cce5f (patch)
tree678256c3452474df31603a4100b08ca936b695e7 /test/files/presentation
parentbeed16825e53077c40ff38b035bfaafb3a4e39d5 (diff)
downloadscala-ed37907d4fe426ba804fee9d6c7c4062ae4cce5f.tar.gz
scala-ed37907d4fe426ba804fee9d6c7c4062ae4cce5f.tar.bz2
scala-ed37907d4fe426ba804fee9d6c7c4062ae4cce5f.zip
Refactoring to prepare modularization of the compiler.
Actual modularization is delayed until 2.12. The one big (one-line) change is to make the interactive compiler independent of scaladoc. We have one "integration test": `MemoryLeaksTest`. This commit adds a bunch of comments marked `TODO: modularize the compiler`, that should be uncommented when we're ready to continue the modularization effort. I decided to merge them commented out to avoid having to rebase xml patches. There's still some chance of bitrot, but I'm willing to take my chances. I previously refactored the build to make it easier to add jars in a coherent way, which hinges on the `init-project-prop` mechanism, so the relevant properties are already injected there.
Diffstat (limited to 'test/files/presentation')
-rw-r--r--test/files/presentation/memory-leaks/MemoryLeaksTest.scala17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/files/presentation/memory-leaks/MemoryLeaksTest.scala b/test/files/presentation/memory-leaks/MemoryLeaksTest.scala
index 1ddeb6ac4a..f09c6f8e2c 100644
--- a/test/files/presentation/memory-leaks/MemoryLeaksTest.scala
+++ b/test/files/presentation/memory-leaks/MemoryLeaksTest.scala
@@ -3,6 +3,7 @@ import java.io.FileOutputStream
import java.util.Calendar
import scala.reflect.internal.util.BatchSourceFile
+import scala.tools.nsc.interactive
import scala.tools.nsc.interactive.tests._
import scala.tools.nsc.io._
import scala.tools.nsc.doc
@@ -25,7 +26,21 @@ import scala.tools.nsc.doc
object Test extends InteractiveTest {
final val mega = 1024 * 1024
- override val withDocComments = true
+ import interactive.Global
+ trait InteractiveScaladocAnalyzer extends interactive.InteractiveAnalyzer with doc.ScaladocAnalyzer {
+ val global : Global
+ override def newTyper(context: Context) = new Typer(context) with InteractiveTyper with ScaladocTyper {
+ override def canAdaptConstantTypeToLiteral = false
+ }
+ }
+
+ private class ScaladocEnabledGlobal extends Global(settings, compilerReporter) {
+ override lazy val analyzer = new {
+ val global: ScaladocEnabledGlobal.this.type = ScaladocEnabledGlobal.this
+ } with InteractiveScaladocAnalyzer
+ }
+
+ override def createGlobal: Global = new ScaladocEnabledGlobal
override def execute(): Unit = memoryConsumptionTest()