Skip to content

Commit eb1908a

Browse files
committed
New utility method: Reporter#errorOrMigrationWarning
1 parent 6a93dd0 commit eb1908a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/dotty/tools/dotc/reporting/Reporter.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ trait Reporting { this: Context =>
106106
reporter.report(new Error(msg, pos))
107107
}
108108

109+
def errorOrMigrationWarning(msg: => String, pos: SourcePosition = NoSourcePosition): Unit =
110+
if (ctx.scala2Mode) migrationWarning(msg, pos) else error(msg, pos)
111+
109112
def restrictionError(msg: => String, pos: SourcePosition = NoSourcePosition): Unit =
110113
error(s"Implementation restriction: $msg", pos)
111114

0 commit comments

Comments
 (0)