From dd0cbbb36a77f042501ce1d61b09c018c9880f43 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Tue, 2 Feb 2021 17:16:48 +0100 Subject: [PATCH] Upgrade to ASM 9.0 Keep up with Scala 2: https://github.com/scala/scala/pull/9477 --- compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala | 2 +- compiler/src/dotty/tools/dotc/config/ScalaSettings.scala | 3 ++- project/Build.scala | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala b/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala index 607af504e1f5..9554ea8010f7 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala @@ -47,7 +47,7 @@ trait BCodeIdiomatic { case "12" => asm.Opcodes.V12 case "13" => asm.Opcodes.V13 case "14" => asm.Opcodes.V14 - case "15" => asm.Opcodes.V15 + case "16" => asm.Opcodes.V16 } lazy val majorVersion: Int = (classfileVersion & 0xFF) diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 70633ec78dd3..b91882a8f949 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -72,8 +72,9 @@ trait CommonScalaSettings { self: Settings.SettingGroup => } class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings { + // Keep synchronized with `classfileVersion` in `BCodeIdiomatic` private val minTargetVersion = 8 - private val maxTargetVersion = 15 + private val maxTargetVersion = 16 private def supportedTargetVersions: List[String] = (minTargetVersion to maxTargetVersion).toList.map(_.toString) diff --git a/project/Build.scala b/project/Build.scala index 73383c11d3a7..65160c36faee 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -491,7 +491,7 @@ object Build { // get libraries onboard libraryDependencies ++= Seq( - "org.scala-lang.modules" % "scala-asm" % "7.3.1-scala-1", // used by the backend + "org.scala-lang.modules" % "scala-asm" % "9.0.0-scala-1", // used by the backend Dependencies.oldCompilerInterface, // we stick to the old version to avoid deprecation warnings "org.jline" % "jline-reader" % "3.15.0", // used by the REPL "org.jline" % "jline-terminal" % "3.15.0",