aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/reporting/Reporter.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-02-23 00:13:32 +0100
committerGuillaume Martres <smarter@ubuntu.com>2016-02-23 17:21:26 +0100
commit03486df4053ec75bce0ec4b6e5f16ceafcbf66e9 (patch)
treec8e93e6f96b0ae543a880c5c818ff980342423c7 /src/dotty/tools/dotc/reporting/Reporter.scala
parent9d24583b44e4b59d07d61c5f051c8e9a8a832148 (diff)
downloaddotty-03486df4053ec75bce0ec4b6e5f16ceafcbf66e9.tar.gz
dotty-03486df4053ec75bce0ec4b6e5f16ceafcbf66e9.tar.bz2
dotty-03486df4053ec75bce0ec4b6e5f16ceafcbf66e9.zip
ConsoleReporter: handling of non-sensical messages is now reusable
This is now handled by a separate trait HideNonSensicalMessages that can be mixed in, similar to UniqueMessagePositions. This way we'll be able to reuse this functionality for other kind of Reporters. This also means that we don't need `doReport` to return a Boolean anymore, so we change it to return a Unit as it did before 065a0026924f722e9844c8e314180bb4cebca236
Diffstat (limited to 'src/dotty/tools/dotc/reporting/Reporter.scala')
-rw-r--r--src/dotty/tools/dotc/reporting/Reporter.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/reporting/Reporter.scala b/src/dotty/tools/dotc/reporting/Reporter.scala
index 95c6d7ae6..f4eb551a1 100644
--- a/src/dotty/tools/dotc/reporting/Reporter.scala
+++ b/src/dotty/tools/dotc/reporting/Reporter.scala
@@ -159,10 +159,8 @@ trait Reporting { this: Context =>
*/
abstract class Reporter {
- /** Report a diagnostic, unless it is suppressed because it is nonsensical
- * @return a diagnostic was reported.
- */
- def doReport(d: Diagnostic)(implicit ctx: Context): Boolean
+ /** Report a diagnostic */
+ 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
@@ -203,7 +201,8 @@ abstract class Reporter {
}
def report(d: Diagnostic)(implicit ctx: Context): Unit =
- if (!isHidden(d) && doReport(d)(ctx.addMode(Mode.Printing)))
+ if (!isHidden(d)) {
+ doReport(d)(ctx.addMode(Mode.Printing))
d match {
case d: ConditionalWarning if !d.enablingOption.value => unreportedWarnings(d.enablingOption.name) += 1
case d: Warning => warningCount += 1
@@ -213,6 +212,7 @@ abstract class Reporter {
case d: Info => // nothing to do here
// match error if d is something else
}
+ }
def incomplete(d: Diagnostic)(implicit ctx: Context): Unit =
incompleteHandler(d)(ctx)