diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-06-14 00:38:30 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-07-04 15:49:06 +0200 |
commit | 62c8f90f3105b8f19a9f29f104ff232438372c73 (patch) | |
tree | 0540ae1ba8aece6fdaffd0210719c979c36d02b3 /src/compiler/scala/tools/nsc/Reporting.scala | |
parent | 98216be3f3e546fc320ab5182ac5c129707db1ce (diff) | |
download | scala-62c8f90f3105b8f19a9f29f104ff232438372c73.tar.gz scala-62c8f90f3105b8f19a9f29f104ff232438372c73.tar.bz2 scala-62c8f90f3105b8f19a9f29f104ff232438372c73.zip |
Uniformly route reporting through reporter.
Sharpen interfaces, reduce footprint of Reporting trait.
Ideally, all reporting should indirect through reporter,
and the `Reporting` trait itself should be restricted to
a single method that retrieves the current `reporter`.
Pull up some more reporting to reflect.internal.
Would like to do more, but need to move partest to the
reflect.internal interface first.
(Its `errorCount` relies on `ERROR.count` in `tools.nsc.Reporter`.)
Diffstat (limited to 'src/compiler/scala/tools/nsc/Reporting.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/Reporting.scala | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/Reporting.scala b/src/compiler/scala/tools/nsc/Reporting.scala index 614eb4f212..a8fd3bec76 100644 --- a/src/compiler/scala/tools/nsc/Reporting.scala +++ b/src/compiler/scala/tools/nsc/Reporting.scala @@ -10,9 +10,15 @@ package nsc import reporters.{ Reporter, ConsoleReporter } import scala.collection.{ mutable, immutable } +/** Provides delegates to the reporter doing the actual work. + * PerRunReporting implements per-Run stateful info tracking and reporting + * + * TODO: make reporting configurable + */ trait Reporting extends scala.reflect.internal.Reporting { self: ast.Positions with CompilationUnits with scala.reflect.api.Symbols => def settings: Settings - def reporter: Reporter + + // == currentRun.reporting def currentReporting: PerRunReporting def supplementTyperState(errorMessage: String): String @@ -21,10 +27,6 @@ trait Reporting extends scala.reflect.internal.Reporting { self: ast.Positions w // nearly every trait really must go. For now using globalError. def error(msg: String) = globalError(msg) - override def inform(pos: Position, msg: String) = reporter.echo(pos, msg) - override def warning(pos: Position, msg: String) = reporter.warning(pos, msg) - override def globalError(pos: Position, msg: String) = reporter.error(pos, msg) - override def deprecationWarning(pos: Position, msg: String) = currentReporting.deprecationWarning(pos, msg) override def supplementErrorMessage(errorMessage: String) = currentReporting.supplementErrorMessage(errorMessage) |