File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ title: 値クラスと汎用トレイト
19
19
20
20
class Wrapper(val underlying: Int) extends AnyVal
21
21
22
- これはただ1つの、public な ` val ` パラメータを持ち、これが内部での実行時のデータ構造となる。
22
+ これはただ1つの、 ` val ` パラメータを持ち、これが内部での実行時のデータ構造となる。
23
23
コンパイル時の型は ` Wrapper ` だが、実行時のデータ構造は ` Int ` だ。
24
24
値クラスは ` def ` を定義することができるが、` val ` 、` var ` 、または入れ子の ` trait ` 、` class ` 、` object ` は許されない:
25
25
@@ -141,7 +141,7 @@ JVM が値クラスという概念をサポートしていないこともあり
141
141
142
142
<!-- keep this html -->
143
143
<ol >
144
- <li > … ただ1つの public で値クラス以外の型の <code >val</code > パラメータを持つプライマリコンストラクタのみを持つことができる。</li >
144
+ <li > … ただ1つの値クラス以外の型の <code >val</code > パラメータを持つプライマリコンストラクタのみを持つことができる。</li >
145
145
<li > … specialized な型パラメータを持つことができない。</li >
146
146
<li > … 入れ子のローカルクラス、トレイト、やオブジェクトを持つことがでない。</li >
147
147
<li > … <code >equals</code > や <code >hashCode</code > メソッドを定義することができない。</li >
@@ -160,7 +160,7 @@ JVM が値クラスという概念をサポートしていないこともあり
160
160
161
161
Scala コンパイラは以下のエラーメッセージを生成する:
162
162
163
- Complex.scala:1: error: value class needs to have exactly one public val parameter
163
+ Complex.scala:1: error: value class needs to have exactly one val parameter
164
164
class Complex(val real: Double, val imag: Double) extends AnyVal
165
165
^
166
166
You can’t perform that action at this time.
0 commit comments