我有一个带有默认参数的无副作用方法,我想在没有括号的情况下调用它,例如:
scala> def foo(x: Int = 1) = 42
foo: (x: Int)Int
scala> foo
<console>:9: error: missing arguments for method foo in object $iw;
follow this method with `_' if you want to treat it as a partially applied function
foo
^
scala> foo()
res3: Int = 42
这是故意的,还是只是暂时的限制?