aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/reporting/StoreReporter.scala
blob: 67c71df153c1391a7c40a84abe928f0556e1b578 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package dotty.tools
package dotc
package reporting

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

/**
 * This class implements a Reporter that stores all messages
 */
class StoreReporter extends Reporter {

  val infos = new mutable.ListBuffer[Diagnostic]

  protected def doReport(d: Diagnostic)(implicit ctx: Context): Unit = {
    println(s">>>> StoredError: ${d.msg}") // !!! DEBUG
    infos += d
  }

  override def flush()(implicit ctx: Context) =
    infos foreach ctx.reporter.report
}