diff options
author | Martin Odersky <odersky@gmail.com> | 2016-02-08 14:34:10 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-02-19 16:56:30 +0100 |
commit | eb1908a9f2c61895cabe70c0ac0ebbe8ef14fcea (patch) | |
tree | cd0085bf1145080d87326e45617c49888b8448c5 | |
parent | 6a93dd0dea9833ecba70d09a414a650227c03fc9 (diff) | |
download | dotty-eb1908a9f2c61895cabe70c0ac0ebbe8ef14fcea.tar.gz dotty-eb1908a9f2c61895cabe70c0ac0ebbe8ef14fcea.tar.bz2 dotty-eb1908a9f2c61895cabe70c0ac0ebbe8ef14fcea.zip |
New utility method: Reporter#errorOrMigrationWarning
-rw-r--r-- | src/dotty/tools/dotc/reporting/Reporter.scala | 3 |
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) |