aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/Driver.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/Driver.scala')
-rw-r--r--src/dotty/tools/dotc/Driver.scala9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/Driver.scala b/src/dotty/tools/dotc/Driver.scala
index 22170a478..1627b6e48 100644
--- a/src/dotty/tools/dotc/Driver.scala
+++ b/src/dotty/tools/dotc/Driver.scala
@@ -34,7 +34,10 @@ abstract class Driver extends DotClass {
def setup(args: Array[String], rootCtx: Context): (List[String], Context) = {
val summary = CompilerCommand.distill(args)(rootCtx)
- implicit val ctx: Context = initCtx.fresh.setSettings(summary.sstate)
+ // FIXME: We should reuse rootCtx instead of creating newCtx, but this
+ // makes some tests fail with "denotation module _root_ invalid in run 2."
+ val newCtx = initCtx.setCompilerCallback(rootCtx.compilerCallback)
+ implicit val ctx: Context = newCtx.fresh.setSettings(summary.sstate)
val fileNames = CompilerCommand.checkUsage(summary, sourcesRequired)
(fileNames, ctx)
}
@@ -44,6 +47,10 @@ abstract class Driver extends DotClass {
doCompile(newCompiler(), fileNames)(ctx)
}
+ def process(args: Array[String], callback: CompilerCallback): Reporter = {
+ process(args, initCtx.setCompilerCallback(callback))
+ }
+
// We overload `process` instead of using a default argument so that we
// can easily call this method using reflection from `RawCompiler` in sbt.
def process(args: Array[String]): Reporter = {