Skip to content

Commit 0ef7ddf

Browse files
Kordyjanprolativ
authored andcommitted
Add -scala-release flag
1 parent da8160f commit 0ef7ddf

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ trait CommonScalaSettings:
101101
val silentWarnings: Setting[Boolean] = BooleanSetting("-nowarn", "Silence all warnings.", aliases = List("--no-warnings"))
102102

103103
val release: Setting[String] = ChoiceSetting("-release", "release", "Compile code with classes specific to the given version of the Java platform available on the classpath and emit bytecode for this version.", ScalaSettings.supportedReleaseVersions, "", aliases = List("--release"))
104+
val scalaRelease: Setting[String] = ChoiceSetting("-scala-release", "release", "Emit TASTy files that can be consumed by specified version of the compiler.", List("3.0", "3.1"), "3.1", aliases = List("--scala-release"))
104105
val deprecation: Setting[Boolean] = BooleanSetting("-deprecation", "Emit warning and location for usages of deprecated APIs.", aliases = List("--deprecation"))
105106
val feature: Setting[Boolean] = BooleanSetting("-feature", "Emit warning and location for usages of features that should be imported explicitly.", aliases = List("--feature"))
106107
val explain: Setting[Boolean] = BooleanSetting("-explain", "Explain errors in more detail.", aliases = List("--explain"))

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,11 @@ trait ParallelTesting extends RunnerOrchestration { self =>
215215

216216
case testSource @ SeparateCompilationSource(_, dir, flags, outDir) =>
217217
testSource.compilationGroups.map { (group, files) =>
218+
val flags1 = if group.target.isEmpty then flags else flags.and("-scala-release", group.target)
218219
if group.compiler.isEmpty then
219-
compile(files, flags, suppressErrors, outDir)
220+
compile(files, flags1, suppressErrors, outDir)
220221
else
221-
compileWithOtherCompiler(group.compiler, files, flags, outDir)
222+
compileWithOtherCompiler(group.compiler, files, flags1, outDir)
222223
}
223224
})
224225

0 commit comments

Comments
 (0)