diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-02-04 02:37:40 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-02-04 23:31:03 +0100 |
commit | 208f7cde44a06947e452ba6c5132704caa4b1c3e (patch) | |
tree | 11dc92116f334a4477b9fcc0674da7089ad4af1e /src/dotty/tools/dotc/Compiler.scala | |
parent | 73fad44a11dafa507e1d358f1bc222b04319a594 (diff) | |
download | dotty-208f7cde44a06947e452ba6c5132704caa4b1c3e.tar.gz dotty-208f7cde44a06947e452ba6c5132704caa4b1c3e.tar.bz2 dotty-208f7cde44a06947e452ba6c5132704caa4b1c3e.zip |
Compiler: use the reporter passed from the Driver
With this commit and the previous one, partest should finally correctly
log the output of the compiler and display it at the end of its
execution if compilation failed.
Also make sure the initial Reporter in a Context is _not_ a ThrowingReporter.
Previously, the initial Reporter was always overriden in Compiler by
rootReporter so it had no effect, but this is not the case anymore, and
the negative junit tests fail with the ThrowingReporter since they throw
an exception instead of exiting with a certain number of errors.
Diffstat (limited to 'src/dotty/tools/dotc/Compiler.scala')
-rw-r--r-- | src/dotty/tools/dotc/Compiler.scala | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/Compiler.scala b/src/dotty/tools/dotc/Compiler.scala index f1ef7afc3..199657864 100644 --- a/src/dotty/tools/dotc/Compiler.scala +++ b/src/dotty/tools/dotc/Compiler.scala @@ -111,15 +111,13 @@ class Compiler { .setOwner(defn.RootClass) .setTyper(new Typer) .setMode(Mode.ImplicitsEnabled) - .setTyperState(new MutableTyperState(ctx.typerState, rootReporter(ctx), isCommittable = true)) + .setTyperState(new MutableTyperState(ctx.typerState, ctx.typerState.reporter, isCommittable = true)) ctx.definitions.init(start) // set context of definitions to start def addImport(ctx: Context, refFn: () => TermRef) = ctx.fresh.setImportInfo(ImportInfo.rootImport(refFn)(ctx)) (start.setRunInfo(new RunInfo(start)) /: defn.RootImportFns)(addImport) } - protected def rootReporter(implicit ctx: Context): Reporter = new ConsoleReporter() - def reset()(implicit ctx: Context): Unit = { ctx.base.reset() ctx.runInfo.clear() |