aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/reporting/Reporter.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-11-02 18:30:39 +0100
committerMartin Odersky <odersky@gmail.com>2015-11-05 13:57:37 +0100
commita0fbe09d945b6b6ef1279e7d6f828bdd3b93cce2 (patch)
tree01d1ba063b9842dc519e5ae33ba9de224758db7a /src/dotty/tools/dotc/reporting/Reporter.scala
parentc16c7f6009c5c7255cf3768585c1115a82b5a38c (diff)
downloaddotty-a0fbe09d945b6b6ef1279e7d6f828bdd3b93cce2.tar.gz
dotty-a0fbe09d945b6b6ef1279e7d6f828bdd3b93cce2.tar.bz2
dotty-a0fbe09d945b6b6ef1279e7d6f828bdd3b93cce2.zip
Add migration warnings
The idea is that whenever Dotty detects a migration problem under -language:Scala2, it should issue a migration warning, so we know what needs to be rewritten.
Diffstat (limited to 'src/dotty/tools/dotc/reporting/Reporter.scala')
-rw-r--r--src/dotty/tools/dotc/reporting/Reporter.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/reporting/Reporter.scala b/src/dotty/tools/dotc/reporting/Reporter.scala
index 0358f71f6..4a72c2066 100644
--- a/src/dotty/tools/dotc/reporting/Reporter.scala
+++ b/src/dotty/tools/dotc/reporting/Reporter.scala
@@ -66,6 +66,9 @@ object Reporter {
class DeprecationWarning(msgFn: => String, pos: SourcePosition) extends ConditionalWarning(msgFn, pos) {
def enablingOption(implicit ctx: Context) = ctx.settings.deprecation
}
+ class MigrationWarning(msgFn: => String, pos: SourcePosition) extends ConditionalWarning(msgFn, pos) {
+ def enablingOption(implicit ctx: Context) = ctx.settings.migration
+ }
}
import Reporter._
@@ -82,6 +85,9 @@ trait Reporting { this: Context =>
def deprecationWarning(msg: => String, pos: SourcePosition = NoSourcePosition): Unit =
reporter.report(new DeprecationWarning(msg, pos))
+ def migrationWarning(msg: => String, pos: SourcePosition = NoSourcePosition): Unit =
+ reporter.report(new MigrationWarning(msg, pos))
+
def uncheckedWarning(msg: => String, pos: SourcePosition = NoSourcePosition): Unit =
reporter.report(new UncheckedWarning(msg, pos))