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
8
8
import util .Property
9
9
10
10
enum SourceVersion :
11
- case `2.13`
12
11
13
12
case `3.0-migration`, `3.0`
14
13
case `3.1-migration`, `3.1`
@@ -22,6 +21,7 @@ enum SourceVersion:
22
21
case `3.9-migration`, `3.9`
23
22
// Add 3.x-migration and 3.x here
24
23
// !!! Keep in sync with scala.runtime.stdlibPatches.language !!!
24
+ case `2.13`
25
25
case `future-migration`, `future`
26
26
27
27
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:
98
98
ctx.reporter.report(new Error (fullMsg, NoSourcePosition ))
99
99
100
100
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)
105
107
106
108
def restrictionError (msg : Message , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
107
109
error(msg.mapMsg(" Implementation restriction: " + _), pos)
You can’t perform that action at this time.
0 commit comments