Skip to content

Fix extension methods typo #2825

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
May 30, 2023
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
2 changes: 1 addition & 1 deletion _ja/overviews/core/value-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ language: ja
def toHexString: String = java.lang.Integer.toHexString(self)
}

実行時には、この `3.toHexString` という式は、新しくインスタンス化されるオブジェクトへのメソッド呼び出しではなく、静的なオブジェクトへのメソッド呼び出しと同様のコード (`RichInt$.MODULE$.extension$toHexString(3)`) へと最適化される。
実行時には、この `3.toHexString` という式は、新しくインスタンス化されるオブジェクトへのメソッド呼び出しではなく、静的なオブジェクトへのメソッド呼び出しと同様のコード (`RichInt$.MODULE$.toHexString$extension(3)`) へと最適化される。

## 正当性

Expand Down
2 changes: 1 addition & 1 deletion _overviews/core/value-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The following fragment of `RichInt` shows how it extends `Int` to allow the expr
}

At runtime, this expression `3.toHexString` is optimised to the equivalent of a method call on a static object
(`RichInt$.MODULE$.extension$toHexString(3)`), rather than a method call on a newly instantiated object.
(`RichInt$.MODULE$.toHexString$extension(3)`), rather than a method call on a newly instantiated object.

## Correctness

Expand Down
2 changes: 1 addition & 1 deletion _zh-cn/overviews/core/value-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Value class只能继承universal traits,但其自身不能再被继承。所
def toHexString: String = java.lang.Integer.toHexString(self)
}

在运行时,表达式3.toHexString 被优化并等价于静态对象的方法调用 (RichInt$.MODULE$.extension$toHexString(3)),而不是创建一个新实例对象,再调用其方法。
在运行时,表达式3.toHexString 被优化并等价于静态对象的方法调用 (RichInt$.MODULE$.toHexString$extension(3)),而不是创建一个新实例对象,再调用其方法。

## 正确性

Expand Down