Scala code:
{ "abc" }
What the type of it? Is it => String
, or just String
?
Maybe it's worth saying that the type of the block is the type of its result expression.
http://www.scala-lang.org/files/archive/spec/2.11/06-expressions.html#blocks
More or less.
The expected type of the final expression e is the expected type of the block.
That's the case (obviously) for f { "abc" }
. You get conversions based on the param type to the function.
It's a String
scala> { "abc" }
res0: String = abc