Skip to content

Commit eb0a369

Browse files
zmerralexarchambault
authored andcommitted
Apply suggestions from code review
Co-authored-by: Alexandre Archambault <[email protected]>
1 parent b9fa123 commit eb0a369

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

modules/build/src/main/scala/scala/build/options/BuildOptions.scala

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -498,17 +498,19 @@ final case class BuildOptions(
498498
version.startsWith("3") && version.endsWith("-NIGHTLY")
499499

500500
val (scalaVersion, scalaBinaryVersion) =
501-
scalaOptions.scalaVersion match {
502-
case Some("3.nightly") => value(computeLatestScalaThreeNightlyVersions())
503-
case Some("2.nightly") => value(computeLatestScalaTwoNightlyVersions())
504-
case Some(versionString) if isScala3Nightly(versionString) =>
505-
value(turnScala3NightlyVersionArgIntoVersion(versionString))
506-
case Some(versionString) if isScala2Nightly(versionString) =>
507-
value(turnScala2NightlyVersionArgToVersions(versionString))
508-
case _ => value(turnScalaVersionArgToScalaVersions(
509-
scalaOptions.scalaVersion,
510-
scalaOptions.scalaBinaryVersion
511-
))
501+
value {
502+
scalaOptions.scalaVersion match {
503+
case Some("3.nightly") => computeLatestScalaThreeNightlyVersions()
504+
case Some("2.nightly") => computeLatestScalaTwoNightlyVersions()
505+
case Some(versionString) if isScala3Nightly(versionString) =>
506+
turnScala3NightlyVersionArgIntoVersion(versionString)
507+
case Some(versionString) if isScala2Nightly(versionString) =>
508+
turnScala2NightlyVersionArgToVersions(versionString)
509+
case _ => turnScalaVersionArgToScalaVersions(
510+
scalaOptions.scalaVersion,
511+
scalaOptions.scalaBinaryVersion
512+
)
513+
}
512514
}
513515

514516
val maybePlatformSuffix = platform.value match {

modules/build/src/test/scala/scala/build/tests/BuildOptionsTests.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ class BuildOptionsTests extends munit.FunSuite {
6767
)
6868
)
6969
assert(
70-
options.projectParams.isLeft && options.projectParams.left.get.isInstanceOf[
71-
UnsupportedScalaVersionError
72-
],
70+
options.projectParams.swap.exists { case _: UnsupportedScalaVersionError => true; case _ => false },
7371
"specifying the 2.11.2 scala version does not lead to the Unsupported Scala Version Error"
7472
)
7573
}

website/docs/commands/compile.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ scala-cli compile --scala 3 Hello.scala
6868

6969
The nightly builds of Scala compiler are unstable ones which are published on a nightly basis.
7070

71-
For using the latest scala 2 and scala 3 nightly builds, you should pass `2.nightly` and `3.nightly`, respectively.
71+
For using the latest Scala 2 and Scala 3 nightly builds, you should pass `2.nightly` and `3.nightly`, respectively.
7272

73-
Scala-cli takes care of fetching the nightly builds of Scala 2 and Scala 3 from different online repositories, without you having to pass their addresses as input after the `--repo` flag.
73+
Scala CLI takes care of fetching the nightly builds of Scala 2 and Scala 3 from different repositories, without you having to pass their addresses as input after the `--repo` flag.
7474

7575
For compiling with the latest Scala 2 nightly build:
7676
```bash
7777
scala-cli Hello.scala -S 2.nightly
7878
```
79-
For compiling with the latest Scala 3 nightly build, in the command line:
79+
For compiling with the latest Scala 3 nightly build:
8080
```bash
8181
scala-cli Hello.scala -S 3.nightly
8282
```

0 commit comments

Comments
 (0)