Skip to content

Missing BuildFrom instance for IterableOnce #11054

Open
@MasseGuillaume

Description

@MasseGuillaume
def foo[T](rs: IterableOnce[Future[T]]): Future[T] = Future.sequence(rs)
Cannot construct a collection of type To with elements of type T based on a collection of type collection.compat.IterableOnce[scala.concurrent.Future[T]].
[error]         Future.sequence(resources)
[error]                        ^

Workaround:

def foo[T](rs: IterableOnce[Future[T]]): Future[T] = Future.sequence(rs.iterator)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions