Skip to content

Commit b1860b4

Browse files
authored
Merge branch 'scala:main' into correct-scala3-zh-cn-link
2 parents b48636e + 58c18aa commit b1860b4

28 files changed

+1327
-121
lines changed

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ keywords:
1616
- Guide
1717

1818
scala-version: 2.13.8
19-
scala-212-version: 2.12.16
19+
scala-212-version: 2.12.17
2020
scala-3-version: 3.2.0
2121

2222
collections:

_getting-started/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: singlepage-overview
33
title: Getting Started
44
partof: getting-started
5-
languages: [fr, ja, uk]
5+
languages: [fr, ja, ru, uk]
66
includeTOC: true
77

88
newcomer_resources:

_getting-started/intellij-track/building-a-scala-project-with-intellij-and-sbt.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Building a Scala Project with IntelliJ and sbt
33
layout: singlepage-overview
44
partof: building-a-scala-project-with-intellij-and-sbt
5-
languages: [ja, uk]
5+
languages: [ja, ru, uk]
66
disqus: true
77
previous-page: getting-started/intellij-track/getting-started-with-scala-in-intellij
88
next-page: testing-scala-in-intellij-with-scalatest
@@ -60,10 +60,9 @@ but here's a glance at what everything is for:
6060
1. Change the code in the class to the following:
6161

6262
```
63-
object Main extends App {
63+
@main def run() =
6464
val ages = Seq(42, 75, 29, 64)
6565
println(s"The oldest person is ${ages.max}")
66-
}
6766
```
6867

6968
Note: IntelliJ has its own implementation of the Scala compiler, and sometimes your
@@ -105,7 +104,7 @@ Continue to the next tutorial in the _getting started with IntelliJ_ series, and
105104

106105
**or**
107106

108-
* [The Scala Book](/overviews/scala-book/introduction.html), which provides a set of short lessons introducing Scala’s main features.
107+
* [The Scala Book](/scala3/book/introduction.html), which provides a set of short lessons introducing Scala’s main features.
109108
* [The Tour of Scala](/tour/tour-of-scala.html) for bite-sized introductions to Scala's features.
110109
- Continue learning Scala interactively online on
111110
[Scala Exercises](https://www.scala-exercises.org/scala_tutorial).

_getting-started/intellij-track/getting-started-with-scala-in-intellij.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Getting Started with Scala in IntelliJ
33
layout: singlepage-overview
44
partof: getting-started-with-scala-in-intellij
5-
languages: [ja, uk]
5+
languages: [ja, ru, uk]
66
disqus: true
77
next-page: building-a-scala-project-with-intellij-and-sbt
88

_getting-started/intellij-track/testing-scala-in-intellij-with-scalatest.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Testing Scala in IntelliJ with ScalaTest
33
layout: singlepage-overview
44
partof: testing-scala-in-intellij-with-scalatest
5-
languages: [ja, uk]
5+
languages: [ja, ru, uk]
66
disqus: true
77
previous-page: building-a-scala-project-with-intellij-and-sbt
88

@@ -31,11 +31,9 @@ This assumes you know [how to build a project in IntelliJ](building-a-scala-proj
3131
1. Call it `CubeCalculator`, change the **Kind** to `object`, and hit enter or double-click on `object`.
3232
1. Replace the code with the following:
3333
```
34-
object CubeCalculator extends App {
35-
def cube(x: Int) = {
34+
object CubeCalculator:
35+
def cube(x: Int) =
3636
x * x * x
37-
}
38-
}
3937
```
4038
4139
## Creating a test
@@ -46,11 +44,10 @@ This assumes you know [how to build a project in IntelliJ](building-a-scala-proj
4644
```
4745
import org.scalatest.funsuite.AnyFunSuite
4846
49-
class CubeCalculatorTest extends AnyFunSuite {
47+
class CubeCalculatorTest extends AnyFunSuite:
5048
test("CubeCalculator.cube") {
5149
assert(CubeCalculator.cube(3) === 27)
5250
}
53-
}
5451
```
5552
1. In the source code, right-click `CubeCalculatorTest` and select
5653
**Run 'CubeCalculatorTest'**.

_getting-started/sbt-track/getting-started-with-scala-and-sbt-on-the-command-line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Getting Started with Scala and sbt on the Command Line
33
layout: singlepage-overview
44
partof: getting-started-with-scala-and-sbt-on-the-command-line
5-
languages: [ja, uk]
5+
languages: [ja, ru, uk]
66
disqus: true
77
next-page: testing-scala-with-sbt-on-the-command-line
88

_getting-started/sbt-track/testing-scala-with-sbt-on-the-command-line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Testing Scala with sbt and ScalaTest on the Command Line
33
layout: singlepage-overview
44
partof: testing-scala-with-sbt-on-the-command-line
5-
languages: [ja, uk]
5+
languages: [ja, ru, uk]
66
disqus: true
77
previous-page: getting-started-with-scala-and-sbt-on-the-command-line
88

_ja/getting-started/intellij-track/building-a-scala-project-with-intellij-and-sbt.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ sbt は、より複雑なプロジェクトを構築すだしたら便利にな
5656
1. クラスのコードを次おように変更します。
5757

5858
```
59-
object Main extends App {
59+
@main def run() =
6060
val ages = Seq(42, 75, 29, 64)
6161
println(s"The oldest person is ${ages.max}")
62-
}
6362
```
6463

6564
注:Intellij は Scala コンパイラーの独自実装を持っており、コードが間違っていると Intellij が示しても正しい場合がときどきあります。

_ja/getting-started/intellij-track/testing-scala-in-intellij-with-scalatest.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ Scala には複数のライブラリとテスト方法がありますが、こ
2626
1. クラスに `CubeCalculator` と名前をつけて、**Kind** を `object` に変更し、**OK** をクリックします。
2727
1. コードを次の通り置き換えます。
2828
```
29-
object CubeCalculator extends App {
30-
def cube(x: Int) = {
29+
object CubeCalculator:
30+
def cube(x: Int) =
3131
x * x * x
32-
}
33-
}
3432
```
3533
3634
## テストを作成
@@ -39,13 +37,12 @@ Scala には複数のライブラリとテスト方法がありますが、こ
3937
1. クラスに `CubeCalculatorTest` と名前を付けて、**OK** をクリックします。
4038
1. コードを次の通り置き換えます。
4139
```
42-
import org.scalatest.FunSuite
40+
import org.scalatest.funsuite.AnyFunSuite
4341
44-
class CubeCalculatorTest extends FunSuite {
42+
class CubeCalculatorTest extends AnyFunSuite:
4543
test("CubeCalculator.cube") {
4644
assert(CubeCalculator.cube(3) === 27)
4745
}
48-
}
4946
```
5047
1. `CubeCalculatorTest` のソースコード内で右クリックし、**Run 'CubeCalculatorTest'** を選択します。
5148

_overviews/jdk-compatibility/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Sometimes new JVM and JDK (Java Development Kit) versions require us to update S
1212

1313
| JDK version | Minimum Scala versions |
1414
|:-----------:|:-------------------------------------------------------------|
15-
| 19 | 3.2.0 (forthcoming), 2.13.9 (forthcoming), 2.12.16 |
15+
| 19 | 3.2.0, 2.13.9 (forthcoming), 2.12.16 |
1616
| 18 | 3.1.3, 2.13.7, 2.12.15 |
1717
| 17 | 3.0.0, 2.13.6, 2.12.15 |
1818
| 11 | 3.0.0, 2.13.0, 2.12.4, 2.11.12 |
@@ -89,8 +89,8 @@ Support for JDK 18 was included in Scala 2.13.7 and 2.12.15.
8989

9090
Early access builds of JDK 19, a non-LTS release, are already available.
9191

92-
Initial support for JDK 19 was included in Scala 2.12.16 and will
93-
also be included in Scala 2.13.9 (forthcoming) and Scala 3.2.0 (forthcoming).
92+
Initial support for JDK 19 was included in Scala 2.12.16 and Scala 3.2.0
93+
and will also be included in Scala 2.13.9 (forthcoming).
9494

9595
## GraalVM Native Image compatibility notes
9696

0 commit comments

Comments
 (0)