Skip to content

Commit ff6e048

Browse files
committed
Make reporter ised in Compiler configurable
Not needed right now, but will be useful later.
1 parent b21d6e5 commit ff6e048

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/dotty/tools/dotc/Compiler.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Periods._
77
import Symbols._
88
import Scopes._
99
import typer.{FrontEnd, Typer, Mode, ImportInfo, RefChecks}
10-
import reporting.ConsoleReporter
10+
import reporting.{Reporter, ConsoleReporter}
1111
import Phases.Phase
1212
import dotty.tools.dotc.transform._
1313
import dotty.tools.dotc.transform.TreeTransforms.{TreeTransform, TreeTransformer}
@@ -105,13 +105,15 @@ class Compiler {
105105
.setOwner(defn.RootClass)
106106
.setTyper(new Typer)
107107
.setMode(Mode.ImplicitsEnabled)
108-
.setTyperState(new MutableTyperState(ctx.typerState, new ConsoleReporter()(ctx), isCommittable = true))
108+
.setTyperState(new MutableTyperState(ctx.typerState, rootReporter(ctx), isCommittable = true))
109109
ctx.definitions.init(start) // set context of definitions to start
110110
def addImport(ctx: Context, symf: () => Symbol) =
111111
ctx.fresh.setImportInfo(ImportInfo.rootImport(symf)(ctx))
112112
(start.setRunInfo(new RunInfo(start)) /: defn.RootImportFns)(addImport)
113113
}
114114

115+
protected def rootReporter(implicit ctx: Context): Reporter = new ConsoleReporter()(ctx)
116+
115117
def reset()(implicit ctx: Context): Unit = {
116118
ctx.base.reset()
117119
ctx.runInfo.clear()

0 commit comments

Comments
 (0)