I found Option[Map[String, String]]
works weirdly like this:
scala> val fileInfo: Option[Map[String, String]] = Some(Map( "type" -> "hoge" ))
fileInfo: Option[Map[String,String]] = Some(Map(type -> hoge))
scala> fileInfo.get("type")
res1: String = hoge
I think the Option
"get" method doesn't take any argument, so this is super weird for me. Why does it work? Is it an implicit conversion or a bug? I want to make sure how it works.
My specifications are:
- Scala version 2.9.2
- Java 1.6.0_43