10000 Support Java 9 bytecode by adding "-target:jvm-1.9" by mkurz · Pull Request #6146 · scala/scala · GitHub
[go: up one dir, main page]

Skip to content

Support Java 9 bytecode by adding "-target:jvm-1.9" #6146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion project/ScalaOptionParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ object ScalaOptionParser {
"-Ymacro-expand" -> List("discard", "none"),
"-Yresolve-term-conflict" -> List("error", "object", "package"),
"-g" -> List("line", "none", "notailcails", "source", "vars"),
"-target" -> List("jvm-1.5", "jvm-1.6", "jvm-1.7", "jvm-1.8"))
"-target" -> List("jvm-1.5", "jvm-1.6", "jvm-1.7", "jvm-1.8", "jvm-9"))
private def multiChoiceSettingNames = Map[String, List[String]](
"-Xlint" -> List("adapted-args", "nullary-unit", "inaccessible", "nullary-override", "infer-any", "missing-interpolator", "doc-detached", "private-shadow", "type-parameter-shadow", "poly-implicit-overload", "option-implicit", "delayedinit-select", "by-name-right-associative", "package-object-classes", "unsound-match", "stars-align"),
"-language" -> List("help", "_", "dynamics", "postfixOps", "reflectiveCalls", "implicitConversions", "higherKinds", "existentials", "experimental.macros"),
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/ant/Scalac.scala
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Scalac extends ScalaMatchingTask with ScalacShared {

/** Defines valid values for the `target` property. */
object Target extends PermissibleValue {
val values = List("jvm-1.5", "jvm-1.6", "jvm-1.7", "jvm-1.8")
val values = List("jvm-1.5", "jvm-1.6", "jvm-1.7", "jvm-1.8", "jvm-9")
}

/** Defines valid values for the `deprecation` and `unchecked` properties. */
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/Global.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
currentRun.reporting.deprecationWarning(NoPosition, s.name + " is deprecated: " + s.deprecationMessage.get, "")
}
val supportedTarget = "jvm-1.8"
if (settings.target.value != supportedTarget) {
if (settings.target.value != supportedTarget && settings.target.value != "jvm-9") {
currentRun.reporting.deprecationWarning(NoPosition, settings.target.name + ":" + settings.target.value + " is deprecated and has no effect, setting to " + supportedTarget, "2.12.0")
settings.target.value = supportedTarget
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ abstract class BackendUtils extends PerRunInit {

lazy val classfileVersion: LazyVar[Int] = perRunLazy(this)(compilerSettings.target match {
case "jvm-1.8" => asm.Opcodes.V1_8
case "jvm-9" => asm.Opcodes.V1_9
})


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ trait StandardScalaSettings {
val optimise: BooleanSetting // depends on post hook which mutates other settings
val print = BooleanSetting ("-print", "Print program with Scala-specific features removed.")
val target = ChoiceSettingForcedDefault ("-target", "target", "Target platform for object files. All JVM 1.5 - 1.7 targets are deprecated.",
List("jvm-1.5", "jvm-1.6", "jvm-1.7", "jvm-1.8"), "jvm-1.8")
List("jvm-1.5", "jvm-1.6", "jvm-1.7", "jvm-1.8", "jvm-9"), "jvm-1.8")
val unchecked = BooleanSetting ("-unchecked", "Enable additional warnings where generated code depends on assumptions.")
val uniqid = BooleanSetting ("-uniqid", "Uniquely tag all identifiers in debugging output.")
val usejavacp = BooleanSetting ("-usejavacp", "Utilize the java.class.path in classpath resolution.")
Expand Down
0