在Scala中,为什么我可以在下面的T m 0(而不是T.m(0))中省略点和大括号?
scala> object T { def m(i:Int) = 0 == i }
defined module T
scala> T m 0
res19: Boolean = true
Run Code Online (Sandbox Code Playgroud)
但为什么我不能n(0)在下面省略这些问题呢?
scala> def n(i:Int) = 0 == i
n: (Int)Boolean
scala> n 0
<console>:1: error: ';' expected but integer literal found.
n 0
^
Run Code Online (Sandbox Code Playgroud)