This works: (1 to 5).reduceLeft( _+_ )
but this doesn't: (x:Int,y:Int)=>_+_
<console>:8: error: missing parameter type for expanded function ((x$1, x$2) => x$1.$plus(x$2))
(x:Int,y:Int)=>_+_
^
<console>:8: error: missing parameter type for expanded function ((x$1: <error>, x$2) => x$1.$plus(x$2))
(x:Int,y:Int)=>_+_
^
It is in way of inconsistent, since in the first case the anonymous function (_+_
) compiled successfully, but failed for the second case.
Is there something I've missed or am mistaken about? Or is it just the syntax definition?