File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ import Feature.isPreviewEnabled
88import util .Property
99
1010enum SourceVersion :
11- case `2.13`
1211
1312 case `3.0-migration`, `3.0`
1413 case `3.1-migration`, `3.1`
@@ -22,6 +21,7 @@ enum SourceVersion:
2221 case `3.9-migration`, `3.9`
2322 // Add 3.x-migration and 3.x here
2423 // !!! Keep in sync with scala.runtime.stdlibPatches.language !!!
24+ case `2.13`
2525 case `future-migration`, `future`
2626
2727 case `never` // needed for MigrationVersion.errorFrom if we never want to issue an error
Original file line number Diff line number Diff line change @@ -98,10 +98,12 @@ object report:
9898 ctx.reporter.report(new Error (fullMsg, NoSourcePosition ))
9999
100100 def errorOrMigrationWarning (msg : Message , pos : SrcPos , migrationVersion : MigrationVersion )(using Context ): Unit =
101- if sourceVersion.isAtLeast(migrationVersion.errorFrom) then
102- if sourceVersion != migrationVersion.errorFrom.prevMigrating then error(msg, pos)
103- else if ctx.settings.rewrite.value.isEmpty then migrationWarning(msg, pos)
104- else if sourceVersion.isAtLeast(migrationVersion.warnFrom) then warning(msg, pos)
101+ if sourceVersion != SourceVersion .`2.13` then
102+ // ignore errors or warningsfor Scala 2 stdlib sources
103+ if sourceVersion.isAtLeast(migrationVersion.errorFrom) then
104+ if sourceVersion != migrationVersion.errorFrom.prevMigrating then error(msg, pos)
105+ else if ctx.settings.rewrite.value.isEmpty then migrationWarning(msg, pos)
106+ else if sourceVersion.isAtLeast(migrationVersion.warnFrom) then warning(msg, pos)
105107
106108 def restrictionError (msg : Message , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
107109 error(msg.mapMsg(" Implementation restriction: " + _), pos)
You can’t perform that action at this time.
0 commit comments