【发布时间】:2016-06-06 14:53:14
【问题描述】:
以下两个命令创建一个Set[Char],然后map-ing 在它上面给出一个Set[String],根据需要:
scala> ('a' to 'z').toSet
res15: scala.collection.immutable.Set[Char] = Set(e, s, ...)
scala> res15.map(_.toString)
res16: scala.collection.immutable.Set[String] = Set(e, s, ...)
但是为什么以下不起作用?
scala> ('a' to 'z').toSet.map(_.toString)
<console>:12: error: missing parameter type for expanded
function ((x$1) => x$1.toString)('a' to 'z').toSet.map(_.toString)
【问题讨论】:
标签: scala