aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/reporting/Reporter.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-10-26 09:47:21 +0100
committerMartin Odersky <odersky@gmail.com>2015-10-26 09:47:21 +0100
commit065a0026924f722e9844c8e314180bb4cebca236 (patch)
tree5b3beb65682e12c729c68ecd2b61b9a4d16bc2f8 /src/dotty/tools/dotc/reporting/Reporter.scala
parentd4f30d1a268a51ee74c98f6ae0f45136274536af (diff)
downloaddotty-065a0026924f722e9844c8e314180bb4cebca236.tar.gz
dotty-065a0026924f722e9844c8e314180bb4cebca236.tar.bz2
dotty-065a0026924f722e9844c8e314180bb4cebca236.zip
Don't count suppressed errors
If an error message was supressed to count it in the total.
Diffstat (limited to 'src/dotty/tools/dotc/reporting/Reporter.scala')
-rw-r--r--src/dotty/tools/dotc/reporting/Reporter.scala25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/dotty/tools/dotc/reporting/Reporter.scala b/src/dotty/tools/dotc/reporting/Reporter.scala
index 7c9d1fa79..0358f71f6 100644
--- a/src/dotty/tools/dotc/reporting/Reporter.scala
+++ b/src/dotty/tools/dotc/reporting/Reporter.scala
@@ -181,8 +181,10 @@ trait Reporting { this: Context =>
*/
abstract class Reporter {
- /** Report a diagnostic */
- def doReport(d: Diagnostic)(implicit ctx: Context): Unit
+ /** Report a diagnostic, unless it is suppressed because it is nonsensical
+ * @return a diagnostic was reported.
+ */
+ def doReport(d: Diagnostic)(implicit ctx: Context): Boolean
/** Whether very long lines can be truncated. This exists so important
* debugging information (like printing the classpath) is not rendered
@@ -220,16 +222,15 @@ abstract class Reporter {
override def default(key: String) = 0
}
- def report(d: Diagnostic)(implicit ctx: Context): Unit = 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
- case d: Error => errorCount += 1
- case d: Info => // nothing to do here
- // match error if d is something else
- }
- }
+ def report(d: Diagnostic)(implicit ctx: Context): Unit =
+ 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
+ case d: Error => errorCount += 1
+ 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)