aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/reporting
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-02-08 14:34:10 +0100
committerMartin Odersky <odersky@gmail.com>2016-02-19 16:56:30 +0100
commiteb1908a9f2c61895cabe70c0ac0ebbe8ef14fcea (patch)
treecd0085bf1145080d87326e45617c49888b8448c5 /src/dotty/tools/dotc/reporting
parent6a93dd0dea9833ecba70d09a414a650227c03fc9 (diff)
downloaddotty-eb1908a9f2c61895cabe70c0ac0ebbe8ef14fcea.tar.gz
dotty-eb1908a9f2c61895cabe70c0ac0ebbe8ef14fcea.tar.bz2
dotty-eb1908a9f2c61895cabe70c0ac0ebbe8ef14fcea.zip
New utility method: Reporter#errorOrMigrationWarning
Diffstat (limited to 'src/dotty/tools/dotc/reporting')
-rw-r--r--src/dotty/tools/dotc/reporting/Reporter.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/reporting/Reporter.scala b/src/dotty/tools/dotc/reporting/Reporter.scala
index d6e8199d8..272b1880f 100644
--- a/src/dotty/tools/dotc/reporting/Reporter.scala
+++ b/src/dotty/tools/dotc/reporting/Reporter.scala
@@ -106,6 +106,9 @@ trait Reporting { this: Context =>
reporter.report(new Error(msg, pos))
}
+ def errorOrMigrationWarning(msg: => String, pos: SourcePosition = NoSourcePosition): Unit =
+ if (ctx.scala2Mode) migrationWarning(msg, pos) else error(msg, pos)
+
def restrictionError(msg: => String, pos: SourcePosition = NoSourcePosition): Unit =
error(s"Implementation restriction: $msg", pos)