【发布时间】:2012-01-26 12:02:45
【问题描述】:
给定:
val m = Map[String, Int]("a" -> 1, "b" -> 2, "c" -> 3)
m.foreach((key: String, value: Int) => println(">>> key=" + key + ", value=" + value))
为什么编译器会抱怨
error: type mismatch
found : (String, Int) => Unit
required: (String, Int) => ?
【问题讨论】: