Skip to content

Commit f956b11

Browse files
authored
Merge pull request scala#9481 from SethTisue/more-targets
make -target support JVM 13, 14, 15, and 16
2 parents 710de52 + ffb48b5 commit f956b11

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

project/ScalaOptionParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,5 @@ object ScalaOptionParser {
140140
private def scaladocPathSettingNames = List("-doc-root-content", "-diagrams-dot-path")
141141
private def scaladocMultiStringSettingNames = List("-doc-external-doc")
142142

143-
private val targetSettingNames = (8 to 12).map(_.toString).flatMap(v => v :: s"jvm-1.$v" :: s"jvm-$v" :: s"1.$v" :: Nil).toList
143+
private val targetSettingNames = (8 to 16).map(_.toString).flatMap(v => v :: s"jvm-1.$v" :: s"jvm-$v" :: s"1.$v" :: Nil).toList
144144
}

src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ abstract class BackendUtils extends PerRunInit {
7676
case "10" => asm.Opcodes.V10
7777
case "11" => asm.Opcodes.V11
7878
case "12" => asm.Opcodes.V12
79+
case "13" => asm.Opcodes.V13
80+
case "14" => asm.Opcodes.V14
81+
case "15" => asm.Opcodes.V15
82+
case "16" => asm.Opcodes.V16
7983
// to be continued...
8084
})
8185

src/compiler/scala/tools/nsc/settings/StandardScalaSettings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ trait StandardScalaSettings { _: MutableSettings =>
7373
object StandardScalaSettings {
7474
// not final in case some separately compiled client code wanted to depend on updated values
7575
val MinTargetVersion = 8
76-
val MaxTargetVersion = 12 // this one goes to twelve
76+
val MaxTargetVersion = 16
7777

7878
private val AllTargetVersions = (MinTargetVersion to MaxTargetVersion).map(_.toString).to(List)
7979
}

test/junit/scala/tools/nsc/settings/TargetTest.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,13 @@ class TargetTest {
5757
check("-target:jvm-12", "12")
5858
check("-target:12", "12")
5959

60+
// (scene missing)
61+
62+
check("-target:jvm-16", "16")
63+
check("-target:16", "16")
64+
6065
checkFail("-target:jvm-6") // no longer
61-
checkFail("-target:jvm-13") // not yet...
66+
checkFail("-target:jvm-17") // not yet...
6267
checkFail("-target:jvm-3000") // not in our lifetime
6368
checkFail("-target:msil") // really?
6469

0 commit comments

Comments
 (0)