aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/reporting/ThrowingReporter.scala
blob: 64350fc0e95bbd26f25e08943fa8499539521d35 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package dotty.tools
package dotc
package reporting

import core.Contexts.Context
import collection.mutable
import Reporter._

/**
 * This class implements a Reporter that throws all errors and sends warnings and other
 * info to the underlying 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)
  }
}