diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-06-24 15:54:10 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-07-04 15:49:08 +0200 |
commit | 9fc68e19309cef139c4827fbed76952011995e10 (patch) | |
tree | 789f30eb129b93efe74d7a026a005fc4a6c53330 /src/compiler/scala/tools/nsc/Reporting.scala | |
parent | b7242013830510776fbb93bbf0e883532133030c (diff) | |
download | scala-9fc68e19309cef139c4827fbed76952011995e10.tar.gz scala-9fc68e19309cef139c4827fbed76952011995e10.tar.bz2 scala-9fc68e19309cef139c4827fbed76952011995e10.zip |
Remove deprecationWarning, currentReporting from Reporting
This moves us a bit closer to the goal of having a single
entry point to reporting.
Must modularize Reporting a bit so it can be used in Variances
(need a reference to `currentRun` in `reflect.internal.Reporting`).
Diffstat (limited to 'src/compiler/scala/tools/nsc/Reporting.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/Reporting.scala | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/compiler/scala/tools/nsc/Reporting.scala b/src/compiler/scala/tools/nsc/Reporting.scala index 1b5a778235..9a20807145 100644 --- a/src/compiler/scala/tools/nsc/Reporting.scala +++ b/src/compiler/scala/tools/nsc/Reporting.scala @@ -18,24 +18,13 @@ import scala.collection.{ mutable, immutable } trait Reporting extends scala.reflect.internal.Reporting { self: ast.Positions with CompilationUnits with scala.reflect.api.Symbols => def settings: Settings - // == currentRun.reporting - def currentReporting: PerRunReporting - - def supplementTyperState(errorMessage: String): String - // not deprecated yet, but a method called "error" imported into // nearly every trait really must go. For now using globalError. def error(msg: String) = globalError(msg) - override def deprecationWarning(pos: Position, msg: String) = currentReporting.deprecationWarning(pos, msg) - override def supplementErrorMessage(errorMessage: String) = currentReporting.supplementErrorMessage(errorMessage) - - // a new instance of this class is created for every Run (access the current instance via `currentReporting`) - class PerRunReporting { - // NOTE: scala.reflect.macros.Parsers#parse relies on everything related to reporting going through this def... - // TODO: can we rework this to avoid the indirection/fragility? - def reporter = Reporting.this.reporter - + // a new instance of this class is created for every Run (access the current instance via `currentRun.reporting`) + protected def PerRunReporting = new PerRunReporting + class PerRunReporting extends PerRunReportingBase { /** Collects for certain classes of warnings during this run. */ private class ConditionalWarning(what: String, option: Settings#BooleanSetting) { val warnings = mutable.LinkedHashMap[Position, String]() @@ -126,13 +115,5 @@ trait Reporting extends scala.reflect.internal.Reporting { self: ast.Positions w if (incompleteHandled) incompleteHandler(pos, msg) else reporter.error(pos, msg) - /** Have we already supplemented the error message of a compiler crash? */ - private[this] var supplementedError = false - def supplementErrorMessage(errorMessage: String): String = - if (supplementedError) errorMessage - else { - supplementedError = true - supplementTyperState(errorMessage) - } } }
\ No newline at end of file |