From 867aab5a53c449d15b436905f2a6ac7e77d4a858 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Fri, 28 Nov 2025 13:49:48 +0100 Subject: [PATCH] Remove deadcode dotty.tools.dotc.config.ScalaRelease --- .../tools/dotc/config/ScalaRelease.scala | 21 ------------------- .../dotc/config/ScalaSettingsProperties.scala | 3 --- .../tools/dotc/transform/PickleQuotes.scala | 1 - .../dotty/tools/dotc/transform/Splicing.scala | 1 - .../tools/dotc/typer/CrossVersionChecks.scala | 2 +- 5 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 compiler/src/dotty/tools/dotc/config/ScalaRelease.scala diff --git a/compiler/src/dotty/tools/dotc/config/ScalaRelease.scala b/compiler/src/dotty/tools/dotc/config/ScalaRelease.scala deleted file mode 100644 index 407171f1a0dd..000000000000 --- a/compiler/src/dotty/tools/dotc/config/ScalaRelease.scala +++ /dev/null @@ -1,21 +0,0 @@ -package dotty.tools.dotc.config - -enum ScalaRelease(val majorVersion: Int, val minorVersion: Int) extends Ordered[ScalaRelease]: - case Release3_0 extends ScalaRelease(3, 0) - case Release3_1 extends ScalaRelease(3, 1) - case Release3_2 extends ScalaRelease(3, 2) - - def show = s"$majorVersion.$minorVersion" - - def compare(that: ScalaRelease) = - val ord = summon[Ordering[(Int, Int)]] - ord.compare((majorVersion, minorVersion), (that.majorVersion, that.minorVersion)) - -object ScalaRelease: - def latest = Release3_1 - - def parse(name: String) = name match - case "3.0" => Some(Release3_0) - case "3.1" => Some(Release3_1) - case "3.2" => Some(Release3_2) - case _ => None diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettingsProperties.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettingsProperties.scala index 60c71d8ceda6..ba9a72dce9d5 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettingsProperties.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettingsProperties.scala @@ -20,9 +20,6 @@ object ScalaSettingsProperties: val maxVersion = Math.min(jdkVersion, maxTargetVersion) (minReleaseVersion to maxVersion).toList.map(_.toString) - def supportedScalaReleaseVersions: List[String] = - ScalaRelease.values.toList.map(_.show) - def supportedSourceVersions: List[String] = SourceVersion.values.diff(SourceVersion.illegalInSettings) .map(_.toString).toList diff --git a/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala b/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala index d9a1ea9ad9af..78d8c8b43a28 100644 --- a/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala +++ b/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala @@ -15,7 +15,6 @@ import ast.TreeTypeMap import NameKinds.* import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.ast.untpd -import dotty.tools.dotc.config.ScalaRelease.* import dotty.tools.dotc.core.Annotations.* import dotty.tools.dotc.core.StdNames.* diff --git a/compiler/src/dotty/tools/dotc/transform/Splicing.scala b/compiler/src/dotty/tools/dotc/transform/Splicing.scala index 967c1cb6d19b..1293d06cd18a 100644 --- a/compiler/src/dotty/tools/dotc/transform/Splicing.scala +++ b/compiler/src/dotty/tools/dotc/transform/Splicing.scala @@ -20,7 +20,6 @@ import dotty.tools.dotc.core.Annotations.* import dotty.tools.dotc.core.Names.* import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.quoted.* -import dotty.tools.dotc.config.ScalaRelease.* import dotty.tools.dotc.staging.StagingLevel.* import dotty.tools.dotc.staging.QuoteTypeTags import dotty.tools.dotc.staging.QuoteTypeTags.* diff --git a/compiler/src/dotty/tools/dotc/typer/CrossVersionChecks.scala b/compiler/src/dotty/tools/dotc/typer/CrossVersionChecks.scala index 6f4eafa52e6d..12c92f39965f 100644 --- a/compiler/src/dotty/tools/dotc/typer/CrossVersionChecks.scala +++ b/compiler/src/dotty/tools/dotc/typer/CrossVersionChecks.scala @@ -6,7 +6,7 @@ import core.* import Annotations.Annotation import Symbols.*, Types.*, Contexts.*, Flags.*, Decorators.*, reporting.* import util.SrcPos -import config.{ScalaVersion, NoScalaVersion, Feature, ScalaRelease} +import config.{ScalaVersion, NoScalaVersion, Feature} import MegaPhase.MiniPhase import scala.util.{Failure, Success} import ast.tpd