Questions tagged «scala-placeholder-syntax»

1
Scala下划线-错误:扩展功能缺少参数类型
我知道对此有很多问题,但是我创建了一个我认为应该有效的简单示例,但仍然没有解决,并且不确定我为什么 val myStrings = new Array[String](3) // do some string initialization // this works myStrings.foreach(println(_)) // ERROR: missing parameter type for expanded function myStrings.foreach(println(_.toString)) 有人可以解释为什么第二条语句不能编译吗?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.