aboutsummaryrefslogtreecommitdiff
path: root/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-04-11 12:17:30 +0200
committerFelix Mulder <felix.mulder@gmail.com>2017-04-12 11:48:32 +0200
commitbcdacee46f04f5bca4732bd487d3cc3c042e23db (patch)
tree69d3de19f61d91df9fb00cc9b86eed5da347a098 /compiler/test/dotty/tools/dotc/reporting/TestReporter.scala
parentf891b224228f7c4939d09ac1849ad562d1298640 (diff)
downloaddotty-bcdacee46f04f5bca4732bd487d3cc3c042e23db.tar.gz
dotty-bcdacee46f04f5bca4732bd487d3cc3c042e23db.tar.bz2
dotty-bcdacee46f04f5bca4732bd487d3cc3c042e23db.zip
Remove need for java written summary reporter
Diffstat (limited to 'compiler/test/dotty/tools/dotc/reporting/TestReporter.scala')
-rw-r--r--compiler/test/dotty/tools/dotc/reporting/TestReporter.scala21
1 files changed, 14 insertions, 7 deletions
diff --git a/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala b/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala
index efba2dc8f..8645882ca 100644
--- a/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala
+++ b/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala
@@ -110,15 +110,22 @@ object TestReporter {
val rep = new TestReporter(writer, writeToLog, WARNING) {
/** Prints the message with the given position indication in a simplified manner */
override def printMessageAndPos(m: MessageContainer, extra: String)(implicit ctx: Context): Unit = {
- val msg = s"${m.pos.line + 1}: " + m.contained.kind + extra
- val extraInfo = inlineInfo(m.pos)
+ def report() = {
+ val msg = s"${m.pos.line + 1}: " + m.contained.kind + extra
+ val extraInfo = inlineInfo(m.pos)
- writer.println(msg)
- _messageBuf.append(msg)
+ writer.println(msg)
+ _messageBuf.append(msg)
- if (extraInfo.nonEmpty) {
- writer.println(extraInfo)
- _messageBuf.append(extraInfo)
+ if (extraInfo.nonEmpty) {
+ writer.println(extraInfo)
+ _messageBuf.append(extraInfo)
+ }
+ }
+ m match {
+ case m: Error => report()
+ case m: Warning => report()
+ case _ => ()
}
}
}