aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/reporting
diff options
context:
space:
mode:
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)