From eb1908a9f2c61895cabe70c0ac0ebbe8ef14fcea Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 8 Feb 2016 14:34:10 +0100 Subject: New utility method: Reporter#errorOrMigrationWarning --- src/dotty/tools/dotc/reporting/Reporter.scala | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/dotty/tools/dotc/reporting') 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) -- cgit v1.2.3