可能重复:
What is the motivation for Scala assignment evaluating to Unit rather than the value assigned?
为什么scala中的赋值会评估为Unit?
var s:String = null
s = "hello" // works
s += " world"
(s = "hello") += " world" // dramatic problem
或括号中有什么神奇的东西吗?