Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以下を使用して Future[Seq[(String, String)]] を Future[Seq[(String)]] に変換しようとしています:
sortedSeq.map(_._2)
そのため、sortedSeq は Future[Seq[(String, String)]] 型です
しかし、私はエラーが発生し続けます:
value _2 is not a member of Seq[(String, String)]
私は何を間違っていますか?
sortedSeq.map はマッピングを Future に適用しますが、Future 内の Seq の要素に適用する必要があります。
次のようなものです:
sortedSeq.map(_.map(_._2))
そのため、将来の Seq の内容にマッピングします。
これを生成するコード サンプルがある場合は、試してみると簡単です。