サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
災害への備え
wheaties.github.io
trait DepValue{ type V val value: V } def magic(that: DepValue): that.V = that.value The return type of "magic" depends on the argument passed in. Toy Example def mk[T](x: T) = new DepValue{ type V = T val value = x } val depInt = mk(1) val depString = mk("two") val itWorks: Int = magic(depInt) val again: String = magic(depString) Other Forms trait Foo{ class Bar def doNothing(b: Bar){} } val f1 =
このページを最初にブックマークしてみませんか?
『wheaties.github.io』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く