Skip to content

Commit 244257b

Browse files
committed
Allow optional rewrite rule in testScala2Mode
1 parent f7091cd commit 244257b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/src/dotty/tools/dotc/core/TypeOps.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,11 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
518518
def dynamicsEnabled =
519519
featureEnabled(defn.LanguageModuleClass, nme.dynamics)
520520

521-
def testScala2Mode(msg: => String, pos: Position) = {
522-
if (scala2Mode) migrationWarning(msg, pos)
521+
def testScala2Mode(msg: => String, pos: Position, rewrite: => Unit = ()) = {
522+
if (scala2Mode) {
523+
migrationWarning(msg, pos)
524+
rewrite
525+
}
523526
scala2Mode
524527
}
525528
}

0 commit comments

Comments
 (0)