LoginSignup
2
2

More than 5 years have passed since last update.

Scalaの「クラス名.type」の意味

Last updated at Posted at 2016-01-15

scala.collection.immutable.List.typeList.typeはどういう文法なのかっていう話です

シングルトンオブジェクトOriginalを作ります

object Original

このオブジェクトOriginalの型がOriginal.typeです!

つまり

val o = Original

を型を省略せずに書くと以下になります

val o: Original.type = Original

なので、タイトルは間違っていて「クラス名.type」ではなく「オブジェクト.type」が正確です

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2