From 7f2f283a1dff4e2dc03ee5aefcdf2feeb0462aa1 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Wed, 1 Jul 2015 15:47:09 +0200 Subject: [PATCH 1/2] Make Reporter.doReport public As reporter.report could actually not report dues to mode flag, we need a way to enforce printing. --- src/dotty/tools/dotc/reporting/Reporter.scala | 2 +- src/dotty/tools/dotc/reporting/StoreReporter.scala | 2 +- src/dotty/tools/dotc/reporting/ThrowingReporter.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dotty/tools/dotc/reporting/Reporter.scala b/src/dotty/tools/dotc/reporting/Reporter.scala index 7c5bab673a15..7adeeac1cb7c 100644 --- a/src/dotty/tools/dotc/reporting/Reporter.scala +++ b/src/dotty/tools/dotc/reporting/Reporter.scala @@ -182,7 +182,7 @@ trait Reporting { this: Context => abstract class Reporter { /** Report a diagnostic */ - protected def doReport(d: Diagnostic)(implicit ctx: Context): Unit + def doReport(d: Diagnostic)(implicit ctx: Context): Unit /** Whether very long lines can be truncated. This exists so important * debugging information (like printing the classpath) is not rendered diff --git a/src/dotty/tools/dotc/reporting/StoreReporter.scala b/src/dotty/tools/dotc/reporting/StoreReporter.scala index 2864c01f85f9..51d3df110666 100644 --- a/src/dotty/tools/dotc/reporting/StoreReporter.scala +++ b/src/dotty/tools/dotc/reporting/StoreReporter.scala @@ -14,7 +14,7 @@ class StoreReporter extends Reporter { private var infos: mutable.ListBuffer[Diagnostic] = null - protected def doReport(d: Diagnostic)(implicit ctx: Context): Unit = { + def doReport(d: Diagnostic)(implicit ctx: Context): Unit = { typr.println(s">>>> StoredError: ${d.msg}") // !!! DEBUG if (infos == null) infos = new mutable.ListBuffer infos += d diff --git a/src/dotty/tools/dotc/reporting/ThrowingReporter.scala b/src/dotty/tools/dotc/reporting/ThrowingReporter.scala index 358b8d249c89..64350fc0e95b 100644 --- a/src/dotty/tools/dotc/reporting/ThrowingReporter.scala +++ b/src/dotty/tools/dotc/reporting/ThrowingReporter.scala @@ -11,7 +11,7 @@ import Reporter._ * info to the underlying reporter. */ class ThrowingReporter(reportInfo: Reporter) extends Reporter { - protected def doReport(d: Diagnostic)(implicit ctx: Context): Unit = d match { + def doReport(d: Diagnostic)(implicit ctx: Context): Unit = d match { case _: Error => throw d case _ => reportInfo.report(d) } From 4de4403479254ecba7cca6a78df2e04d06641e59 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Wed, 1 Jul 2015 15:47:53 +0200 Subject: [PATCH 2/2] Fix #704, make reporters print messages Previously was swallowed in `isHidden` inside `report` --- src/dotty/tools/dotc/reporting/ThrowingReporter.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dotty/tools/dotc/reporting/ThrowingReporter.scala b/src/dotty/tools/dotc/reporting/ThrowingReporter.scala index 64350fc0e95b..0264530369f5 100644 --- a/src/dotty/tools/dotc/reporting/ThrowingReporter.scala +++ b/src/dotty/tools/dotc/reporting/ThrowingReporter.scala @@ -13,6 +13,6 @@ import Reporter._ class ThrowingReporter(reportInfo: Reporter) extends Reporter { def doReport(d: Diagnostic)(implicit ctx: Context): Unit = d match { case _: Error => throw d - case _ => reportInfo.report(d) + case _ => reportInfo.doReport(d) } }