Skip to content

Commit f992c14

Browse files
committed
Make msg in testScala2Mode by-name.
Avoids potentially expensive string assembly operations.
1 parent bb7069c commit f992c14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
546546
def dynamicsEnabled =
547547
featureEnabled(defn.LanguageModuleClass, nme.dynamics)
548548

549-
def testScala2Mode(msg: String, pos: Position) = {
549+
def testScala2Mode(msg: => String, pos: Position) = {
550550
if (scala2Mode) migrationWarning(msg, pos)
551551
scala2Mode
552552
}

0 commit comments

Comments
 (0)