为什么这里需要括号?我应该知道一些优先规则吗?
scala> 'x' match { case _ => 1 } + 1
<console>:1: error: ';' expected but identifier found.
'x' match { case _ => 1 } + 1
^
scala> ('x' match { case _ => 1 }) + 1
res2: Int = 2
Run Code Online (Sandbox Code Playgroud)
谢谢!