Skip to content

Commit 840aa93

Browse files
committed
Fix rebase breakage around reporters.
Reporters are part of the context which is passed into a compiler run. Passing them as a separate option is an unnecessary complication.
1 parent 5fff6d8 commit 840aa93

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/dotty/tools/dotc/FromTasty.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ object FromTasty extends Driver {
4242
List(new ReadTastyTreesFromClasses) :: backendPhases
4343
}
4444

45-
override def newRun(implicit ctx: Context, reporter: Option[Reporter] = None): Run = {
45+
override def newRun(implicit ctx: Context): Run = {
4646
reset()
4747
new TASTYRun(this)(rootContext)
4848
}

test/dotty/partest/DPDirectCompiler.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ class DPDirectCompiler(runner: DPTestRunner) extends nest.DirectCompiler(runner)
2323
}
2424

2525
try {
26-
val processor = if (opts0.exists(_.startsWith("#"))) dotty.tools.dotc.Bench else dotty.tools.dotc.Main
26+
val processor =
27+
if (opts0.exists(_.startsWith("#"))) dotty.tools.dotc.Bench else dotty.tools.dotc.Main
2728
val clogger = new ConsoleReporter(writer = clogWriter)(ctx)
28-
val reporter = processor.process((sources.map(_.toString) ::: opts0).toArray, ctx, Some(clogger))
29+
val logCtx = ctx.fresh.setTyperState(ctx.typerState.withReporter(clogger))
30+
val reporter = processor.process((sources.map(_.toString) ::: opts0).toArray, logCtx)
2931
if (!reporter.hasErrors) runner.genPass()
3032
else {
3133
reporter.printSummary(ctx)

0 commit comments

Comments
 (0)