From 5e599cc14ac0dfe9f7b7605e537808c927e7a6a3 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 27 Apr 2016 10:33:00 +0200 Subject: Rename Reporting#println -> Reporting#echo There's a trap otherwise that, when in a class inheriting from Context (and with it Reporting) a call to println will go to this.println and therefore might not print at all, if the current context buffers messages. I lost a lot of time on this on several occasions when I scratched my head why a simple debug println would not show. Better avoid this in the future for myself and others. --- src/dotty/tools/dotc/Run.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dotty/tools/dotc/Run.scala') diff --git a/src/dotty/tools/dotc/Run.scala b/src/dotty/tools/dotc/Run.scala index 7a0e555e4..928a59214 100644 --- a/src/dotty/tools/dotc/Run.scala +++ b/src/dotty/tools/dotc/Run.scala @@ -35,7 +35,7 @@ class Run(comp: Compiler)(implicit ctx: Context) { compileSources(sources) } catch { case NonFatal(ex) => - ctx.println(i"exception occurred while compiling $units%, %") + ctx.echo(i"exception occurred while compiling $units%, %") throw ex } @@ -74,8 +74,8 @@ class Run(comp: Compiler)(implicit ctx: Context) { val prevPhase = ctx.phase.prev // can be a mini-phase val squashedPhase = ctx.squashed(prevPhase) - ctx.println(s"result of $unit after ${squashedPhase}:") - ctx.println(unit.tpdTree.show(ctx)) + ctx.echo(s"result of $unit after ${squashedPhase}:") + ctx.echo(unit.tpdTree.show(ctx)) } def compile(sourceCode: String): Unit = { -- cgit v1.2.3