Skip to content

Commit 363970e

Browse files
[LTS only] Fix synchronization of -java-output-versions with JVM backend (#22403)
Fixes a bug in Scala settings after #22111 which edited wrong `ScalaSettings.scala` file - the backport to LTS updated max JDK version in the `pos/compiler-with-cc` tests directory instead of the one in the main sources.
2 parents 17f3055 + 05e0b68 commit 363970e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import dotty.tools.dotc.config.SourceVersion
99
import dotty.tools.dotc.core.Contexts.*
1010
import dotty.tools.dotc.rewrites.Rewrites
1111
import dotty.tools.io.{AbstractFile, Directory, JDK9Reflectors, PlainDirectory}
12+
import dotty.tools.backend.jvm.BackendUtils.classfileVersionMap
1213
import Setting.ChoiceWithHelp
1314

1415
import scala.util.chaining.*
@@ -19,8 +20,8 @@ class ScalaSettings extends SettingGroup with AllScalaSettings
1920

2021
object ScalaSettings:
2122
// Keep synchronized with `classfileVersion` in `BackendUtils`
22-
private val minTargetVersion = 8
23-
private val maxTargetVersion = 22
23+
private lazy val minTargetVersion = classfileVersionMap.keysIterator.min
24+
private lazy val maxTargetVersion = classfileVersionMap.keysIterator.max
2425

2526
def supportedTargetVersions: List[String] =
2627
(minTargetVersion to maxTargetVersion).toList.map(_.toString)

0 commit comments

Comments
 (0)