Skip to content

Remove the redundant 'val' and 'new' keywords #1450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _ba/tour/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Međutim, lakše je čitati kada se napiše kao infiksni operator:
Možete koristiti bilo koji legalni identifikator kao operator.
To uključuje i imena kao `add` ili simbole kao `+`.
```tut
case class Vec(val x: Double, val y: Double) {
def +(that: Vec) = new Vec(this.x + that.x, this.y + that.y)
case class Vec(x: Double, y: Double) {
def +(that: Vec) = Vec(this.x + that.x, this.y + that.y)
}

val vector1 = Vec(1.0, 1.0)
Expand Down
4 changes: 2 additions & 2 deletions _ja/tour/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Scalaでは演算子はメソッドです。パラメータを1つだけ持つ

有効な識別子であれば演算子として使用できます。これは `add`のような名前も`+`のような記号も含みます。
```tut
case class Vec(val x: Double, val y: Double) {
def +(that: Vec) = new Vec(this.x + that.x, this.y + that.y)
case class Vec(x: Double, y: Double) {
def +(that: Vec) = Vec(this.x + that.x, this.y + that.y)
}

val vector1 = Vec(1.0, 1.0)
Expand Down
4 changes: 2 additions & 2 deletions _ru/tour/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ prerequisite-knowledge: case-classes
## Создание и использование операторов
В качестве оператора можно использовать любой допустимый символ. Включая имена на подобии `add` или символ (символы) типа `+`.
```tut
case class Vec(val x: Double, val y: Double) {
def +(that: Vec) = new Vec(this.x + that.x, this.y + that.y)
case class Vec(x: Double, y: Double) {
def +(that: Vec) = Vec(this.x + that.x, this.y + that.y)
}

val vector1 = Vec(1.0, 1.0)
Expand Down
4 changes: 2 additions & 2 deletions _tour/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ However, it's easier to read as an infix operator:
## Defining and using operators
You can use any legal identifier as an operator. This includes a name like `add` or a symbol(s) like `+`.
```tut
case class Vec(val x: Double, val y: Double) {
def +(that: Vec) = new Vec(this.x + that.x, this.y + that.y)
case class Vec(x: Double, y: Double) {
def +(that: Vec) = Vec(this.x + that.x, this.y + that.y)
}

val vector1 = Vec(1.0, 1.0)
Expand Down
4 changes: 2 additions & 2 deletions _zh-cn/tour/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ previous-page: type-inference
## 定义和使用运算符
你可以使用任何合法标识符作为运算符。 包括像 `add` 这样的名字或像 `+` 这样的符号。
```tut
case class Vec(val x: Double, val y: Double) {
def +(that: Vec) = new Vec(this.x + that.x, this.y + that.y)
case class Vec(x: Double, y: Double) {
def +(that: Vec) = Vec(this.x + that.x, this.y + that.y)
}

val vector1 = Vec(1.0, 1.0)
Expand Down