我最近开始玩Scala(2.8)并注意到我可以编写以下代码(在Scala Interpreter中):
scala> var x : Unit = 10 x : Unit = ()
现在发生的事情并不明显.我真的没想到看到任何隐含的单位转换.
scala unit-type
scala ×1
unit-type ×1