File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
src/dotty/tools/dotc/reporting Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -247,12 +247,23 @@ abstract class Reporter {
247247 incompleteHandler(d)(ctx)
248248
249249
250- /** Print a summary */
251- def printSummary (implicit ctx : Context ): Unit = {
252- if (warningCount > 0 ) ctx.println(countString(warningCount, " warning" ) + " found" )
253- if (errorCount > 0 ) ctx.println(countString(errorCount, " error" ) + " found" )
250+ /** Summary of warnings and errors */
251+ def summary : String = {
252+ val b = new mutable.ListBuffer [String ]
253+ if (warningCount > 0 )
254+ b += countString(warningCount, " warning" ) + " found"
255+ if (errorCount > 0 )
256+ b += countString(errorCount, " error" ) + " found"
254257 for ((settingName, count) <- unreportedWarnings)
255- ctx.println(s " there were $count ${settingName.tail} warning(s); re-run with $settingName for details " )
258+ b += s " there were $count ${settingName.tail} warning(s); re-run with $settingName for details "
259+ b.mkString(" \n " )
260+ }
261+
262+ /** Print the summary of warnings and errors */
263+ def printSummary (implicit ctx : Context ): Unit = {
264+ val s = summary
265+ if (s != " " )
266+ ctx.println(s)
256267 }
257268
258269 /** Returns a string meaning "n elements". */
You can’t perform that action at this time.
0 commit comments