エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
matching case classes with type parameters? | The Scala Programming Language
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
matching case classes with type parameters? | The Scala Programming Language
I have a newbie question that perhaps someone can help me with. I'm trying to have a base class w... I have a newbie question that perhaps someone can help me with. I'm trying to have a base class with a type parameter and a pattern match: abstract class X[T](var a : T) { // some type independent code (omitted)... // type dependent def field2val(field : String) { this match { case floatX(_) => a = field.toFloat; case intX(_) => a = field.toInt; } } } case class floatX(a : Float) extends X[Float](