まず、これ:
"1 2".split(" ").toSet
この:
Set("1", "2")
どちらも同じものに評価されます。つまり、
res1: scala.collection.immutable.Set[String] = Set(1, 2)
なぜ、私がするとき:
Set("1", "2") map (_.toInt)
私はこれを期待どおりに取得します:
res2: scala.collection.immutable.Set[Int] = Set(1, 2)
しかし、私がこれを行うと:
"1 2".split(" ").toSet map (_.toInt)
私が得た:
<console>:12: error: missing parameter type for expanded function ((x$1) => x$1.toInt)
"1 2".split(" ").toSet map (_.toInt)
確認しましたが、括弧を追加しても問題は解決しません。