Skip to content

Commit 3f978b3

Browse files
authored
Merge pull request #13617 from dotty-staging/allow-3.1
2 parents 65b4326 + b9fb91b commit 3f978b3

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ object Feature:
9191
def warnOnMigration(msg: Message, pos: SrcPos,
9292
version: SourceVersion = defaultSourceVersion)(using Context): Boolean =
9393
if sourceVersion.isMigrating && sourceVersion.stable == version
94-
|| version == `3.0` && migrateTo3
94+
|| (version == `3.0` || version == `3.1`) && migrateTo3
9595
then
9696
report.migrationWarning(msg, pos)
9797
true

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ trait AllScalaSettings extends CommonScalaSettings, VerboseSettings, WarningSett
5252
// it is otherwise subsumed by -explain, and should be dropped as soon as we can.
5353
val explain: Setting[Boolean] = BooleanSetting("-explain", "Explain errors in more detail.", aliases = List("--explain"))
5454
val feature: Setting[Boolean] = BooleanSetting("-feature", "Emit warning and location for usages of features that should be imported explicitly.", aliases = List("--feature"))
55-
val source: Setting[String] = ChoiceSetting("-source", "source version", "source version", List("3.0", "future", "3.0-migration", "future-migration"), "3.0", aliases = List("--source"))
55+
val source: Setting[String] = ChoiceSetting("-source", "source version", "source version", List("3.0", "3.1", "future", "3.0-migration", "future-migration"), "3.0", aliases = List("--source"))
5656
val unchecked: Setting[Boolean] = BooleanSetting("-unchecked", "Enable additional warnings where generated code depends on assumptions.", initialValue = true, aliases = List("--unchecked"))
5757
val uniqid: Setting[Boolean] = BooleanSetting("-uniqid", "Uniquely tag all identifiers in debugging output.", aliases = List("--unique-id"))
5858
val language: Setting[List[String]] = MultiStringSetting("-language", "feature", "Enable one or more language features.", aliases = List("--language"))

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import core.Decorators.{_, given}
99
import util.Property
1010

1111
enum SourceVersion:
12-
case `3.0-migration`, `3.0`, `future-migration`, `future`
12+
case `3.0-migration`, `3.0`, `3.1`, `future-migration`, `future`
1313

1414
val isMigrating: Boolean = toString.endsWith("-migration")
1515

compiler/test/dotty/tools/dotc/CompilationTests.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class CompilationTests {
3737
compileFilesInDir("tests/pos-special/spec-t5545", defaultOptions),
3838
compileFilesInDir("tests/pos-special/strawman-collections", allowDeepSubtypes),
3939
compileFilesInDir("tests/pos-special/isInstanceOf", allowDeepSubtypes.and("-Xfatal-warnings")),
40-
compileFilesInDir("tests/new", defaultOptions),
40+
compileFilesInDir("tests/new", defaultOptions.and("-source", "3.1")), // just to see whether 3.1 works
4141
compileFilesInDir("tests/pos-scala2", scala2CompatMode),
4242
compileFilesInDir("tests/pos-custom-args/erased", defaultOptions.and("-language:experimental.erasedDefinitions")),
4343
compileFilesInDir("tests/pos", defaultOptions.and("-Ysafe-init")),

0 commit comments

Comments
 (0)