Open
Description
Follow-up for #11868.
converting a mutable collection (to(collection.mutable.X)
, to(collection.X)
, toArray
) always creates a copy, even if the original collection has a conforming type. converting an immutable collection doesn't copy if the collection's type conforms to the result.
- https://github.com/scala/docs.scala-lang/blob/7daca3fc7ef4dfc047d9bbf96ca324b8a43c44b4/_overviews/collections-2.13/trait-iterable.md#L25 (for https://docs.scala-lang.org/overviews/collections-2.13/trait-iterable.html)
- https://github.com/scala/scala/blob/9090f2813e697a1092303ddbcef7b0783b393b63/src/library/scala/collection/IterableOnce.scala#L1246-L1289