エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Unchecked Ducktyping in Scala
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Unchecked Ducktyping in Scala
I finally had an occasion to to use Scala's structured typing, although not in the way it was int... I finally had an occasion to to use Scala's structured typing, although not in the way it was intended. I needed to call a method on a class that was compiled during runtime. Therefore I had no type information on it. So I cast it to a structural type. Here is something you can try that illustrates the principal: scala> val o:AnyRef = "hi" o: AnyRef = hi scala> o.asInstanceOf[ { def length():Int }

