aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/reporting/Reporter.scala
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-09-16 18:23:11 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-10-10 13:25:33 +0200
commit2764609bb17dfc8691d33fcc1c70a9891af59e70 (patch)
treecbb0c188a5fc83b7d91256502e4c4f42fd5fcd26 /src/dotty/tools/dotc/reporting/Reporter.scala
parent2b2cfe71aacb50e91d6956f0d4ee7d555537698a (diff)
downloaddotty-2764609bb17dfc8691d33fcc1c70a9891af59e70.tar.gz
dotty-2764609bb17dfc8691d33fcc1c70a9891af59e70.tar.bz2
dotty-2764609bb17dfc8691d33fcc1c70a9891af59e70.zip
Complete better structure to diagnostic messages
Diffstat (limited to 'src/dotty/tools/dotc/reporting/Reporter.scala')
-rw-r--r--src/dotty/tools/dotc/reporting/Reporter.scala22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/dotty/tools/dotc/reporting/Reporter.scala b/src/dotty/tools/dotc/reporting/Reporter.scala
index ccbae94bf..5c3dcccb7 100644
--- a/src/dotty/tools/dotc/reporting/Reporter.scala
+++ b/src/dotty/tools/dotc/reporting/Reporter.scala
@@ -10,9 +10,9 @@ import config.Printers
import java.lang.System.currentTimeMillis
import core.Mode
import dotty.tools.dotc.core.Symbols.Symbol
-import diagnostic.Message
-import ErrorMessages._
-import diagnostic.basic._
+import diagnostic.messages._
+import diagnostic._
+import MessageCreator._
object Reporter {
/** Convert a SimpleReporter into a real Reporter */
@@ -75,10 +75,10 @@ trait Reporting { this: Context =>
def warning(msg: => String, pos: SourcePosition = NoSourcePosition): Unit =
reporter.report(new Warning(msg, pos))
- def explainWarning(err: => ErrorMessage, pos: SourcePosition = NoSourcePosition): Unit = {
- reporter.report(new Warning(err.msg, pos, s"${err.kind} warning"))
- if (this.shouldExplain(err))
- reporter.report(new Info(err.explanation, NoSourcePosition))
+ def explainWarning(msg: => MessageCreator, pos: SourcePosition = NoSourcePosition): Unit = {
+ reporter.report(msg.warning(pos))
+ if (this.shouldExplain(msg))
+ reporter.report(new Info(msg.explanation, NoSourcePosition))
}
def strictWarning(msg: => String, pos: SourcePosition = NoSourcePosition): Unit =
@@ -90,10 +90,10 @@ trait Reporting { this: Context =>
reporter.report(new Error(msg, pos))
}
- def explainError(err: => ErrorMessage, pos: SourcePosition = NoSourcePosition): Unit = {
- reporter.report(new Error(err.msg, pos, s"${err.kind} error"))
- if (this.shouldExplain(err))
- reporter.report(new Info(err.explanation, NoSourcePosition))
+ def explainError(msg: => MessageCreator, pos: SourcePosition = NoSourcePosition): Unit = {
+ reporter.report(msg.error(pos))
+ if (this.shouldExplain(msg))
+ reporter.report(new Info(msg.explanation, NoSourcePosition))
}
def errorOrMigrationWarning(msg: => String, pos: SourcePosition = NoSourcePosition): Unit =