我定义foo
:
scala> def foo(x: Int, y:Int): Int = x + y
foo: (x: Int, y: Int)Int
然后,我无法设置bar
等于curried
的功能foo
。
scala> def bar = foo.curried
<console>:8: error: missing arguments for method foo;
follow this method with `_' if you want to treat it as a partially applied
function
def bar = foo.curried
^
我究竟做错了什么?