Skip to content

Fix extension methods example in the ja documentation #484

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 2 commits into from
Jan 12, 2016
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 @@ -47,7 +47,7 @@ title: 値クラスと汎用トレイト

`RichInt` から抜粋した以下のコードは、それが `Int` を拡張して `3.toHexString` という式が書けるようにしていることを示す:

class RichInt(val self: Int) extends AnyVal {
implicit class RichInt(val self: Int) extends AnyVal {
def toHexString: String = java.lang.Integer.toHexString(self)
}

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 @@ -40,7 +40,7 @@ Value class只能继承universal traits,但其自身不能再被继承。所

下面有关RichInt的代码片段示范了RichInt是如何继承Int来允许3.toHexString的表达式:

class RichInt(val self: Int) extends AnyVal {
implicit class RichInt(val self: Int) extends AnyVal {
def toHexString: String = java.lang.Integer.toHexString(self)
}

Expand Down