diff options
author | Martin Odersky <odersky@gmail.com> | 2013-07-19 20:14:08 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-07-19 23:54:31 +0200 |
commit | a39551f990be08dc7168374e74228b9388160aec (patch) | |
tree | 34d1e2015f78abf2cb6aa837088d52f8b12f359f /src/dotty/tools/dotc/reporting/Reporter.scala | |
parent | 919310a29daebabe3335d428f5f5e52ed6295cbd (diff) | |
download | dotty-a39551f990be08dc7168374e74228b9388160aec.tar.gz dotty-a39551f990be08dc7168374e74228b9388160aec.tar.bz2 dotty-a39551f990be08dc7168374e74228b9388160aec.zip |
Integrated reporting into TyperState.
Diffstat (limited to 'src/dotty/tools/dotc/reporting/Reporter.scala')
-rw-r--r-- | src/dotty/tools/dotc/reporting/Reporter.scala | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/reporting/Reporter.scala b/src/dotty/tools/dotc/reporting/Reporter.scala index 2f580c2f9..5ebc5934f 100644 --- a/src/dotty/tools/dotc/reporting/Reporter.scala +++ b/src/dotty/tools/dotc/reporting/Reporter.scala @@ -11,9 +11,11 @@ import config.Settings.Setting import java.lang.System.currentTimeMillis object Reporter { - class Diagnostic(msgFn: => String, val pos: SourcePosition, val severity: Severity) { + + class Diagnostic(msgFn: => String, val pos: SourcePosition, val severity: Severity) extends Exception { lazy val msg: String = msgFn override def toString = s"$severity at $pos: $msg" + override def getMessage() = msg } class Severity(val level: Int) extends AnyVal { @@ -127,7 +129,7 @@ trait Reporting { this: Context => * This interface provides methods to issue information, warning and * error messages. */ -abstract class Reporter(ctx: Context) { +abstract class Reporter { /** Report a diagnostic */ protected def doReport(d: Diagnostic)(implicit ctx: Context): Unit @@ -217,5 +219,5 @@ abstract class Reporter(ctx: Context) { } } - def flush(): Unit = {} + def flush()(implicit ctx: Context): Unit = {} } |