All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dotty.tools.dotc.config.ScalaRelease.scala Maven / Gradle / Ivy

There is a newer version: 3.6.4-RC1-bin-20241220-0bfa1af-NIGHTLY
Show newest version
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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy