이 작동 (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)=>_+_
^
그것은 첫 번째 경우에 이후, 성공적으로 컴파일 된 익명 함수 (_+_
)를 일관성 나타나지만 두 번째 경우에는 실패했습니다.
내가 놓친 부분이나 잘못 본 부분이 있습니까? 아니면 구문 정의입니까?
아마도 'val f : Function2 [Int, Int, Int] = _ + _'과 같은 것을 의미했을 것입니다. –