Skip to content

Commit 9a828b8

Browse files
committed
Make warnOnMigration respect -language:Scala2Compat
1 parent bbe3765 commit 9a828b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/config/Feature.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ object Feature:
7272
*/
7373
def warnOnMigration(msg: Message, pos: SourcePosition,
7474
version: SourceVersion = defaultSourceVersion)(using Context): Boolean =
75-
if sourceVersion.isMigrating && sourceVersion.stable == version then
75+
if sourceVersion.isMigrating && sourceVersion.stable == version
76+
|| version == `3.0` && migrateTo3
77+
then
7678
ctx.migrationWarning(msg, pos)
7779
true
7880
else

0 commit comments

Comments
 (0)