From 532ef331eb050454d33a3063b48b581db874d57a Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Mon, 7 Jul 2014 10:14:57 +0200 Subject: Restore reporter forwarders in CompilationUnit Deprecate them so that we can remove them in a couple of 2.11.x releases. Plenty of plugins were probably using `unit.error` et al. The continuations plugin was, for one (remedying this with pending PR). --- src/compiler/scala/tools/nsc/CompilationUnits.scala | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/CompilationUnits.scala b/src/compiler/scala/tools/nsc/CompilationUnits.scala index 1ad206f519..f23bca77cd 100644 --- a/src/compiler/scala/tools/nsc/CompilationUnits.scala +++ b/src/compiler/scala/tools/nsc/CompilationUnits.scala @@ -123,8 +123,21 @@ trait CompilationUnits { global: Global => */ val icode: LinkedHashSet[icodes.IClass] = new LinkedHashSet + @deprecated("Call global.reporter.echo directly instead.", "2.11.2") + final def echo(pos: Position, msg: String): Unit = reporter.echo(pos, msg) + @deprecated("Call global.reporter.error (or typer.context.error) directly instead.", "2.11.2") + final def error(pos: Position, msg: String): Unit = reporter.error(pos, msg) + @deprecated("Call global.reporter.warning (or typer.context.warning) directly instead.", "2.11.2") + final def warning(pos: Position, msg: String): Unit = reporter.warning(pos, msg) + + @deprecated("Call global.currentRun.reporting.deprecationWarning directly instead.", "2.11.2") + final def deprecationWarning(pos: Position, msg: String): Unit = currentRun.reporting.deprecationWarning(pos, msg) + @deprecated("Call global.currentRun.reporting.uncheckedWarning directly instead.", "2.11.2") + final def uncheckedWarning(pos: Position, msg: String): Unit = currentRun.reporting.uncheckedWarning(pos, msg) + // called by ScalaDocAnalyzer, overridden by the IDE (in Reporter) // TODO: don't use reporter to communicate comments from parser to IDE! + @deprecated("This method will be removed.", "2.11.2") final def comment(pos: Position, msg: String): Unit = reporter.comment(pos, msg) -- cgit v1.2.3