p
当我这样做时,编译器告诉我“缺少参数类型” :
case class MapResult(input: Any, output: Map[_ <: Any, Any]) {
override def toString = output.map(p => input + " " + p._1 + " " + p._2 ).mkString("\n")
}
然后它告诉我
identifier expected but string literal found.
[error] override def toString = output.map(p: (Any, Any) => input + " " + p._1 + " " + p._2 ).mkString("\n")
^
对于以下内容:
case class MapResult(input: Any, output: Map[_ <: Any, Any]) {
override def toString = output.map(p: (Any, Any) => input + " " + p._1 + " " + p._2 ).mkString("\n")
}