我正在尝试基于此在 REPL 上使用 Play2 创建一个简单的 Iteratee 。但我得到一个missing parameters
错误。但是,如果我为其提供类型参数ele
就可以了。有人可以解释一下吗?
scala> import play.api.libs.iteratee._
import play.api.libs.iteratee._
scala> import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.ExecutionContext.Implicits.global
scala> val i = Iteratee.fold(0){ ( acc, ele ) => acc + ele }
<console>:15: error: missing parameter type
val i = Iteratee.fold(0){ ( acc, ele ) => acc + ele }
^
scala> val i = Iteratee.fold(0){ ( acc, ele:Int ) => acc + ele }
i: play.api.libs.iteratee.Iteratee[Int,Int] = play.api.libs.iteratee.ContIteratee@3feaaa9b