Skip to content

Document and add tests: collection conversions of mutable create a copy #11872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lrytz opened this issue Jan 31, 2020 · 4 comments
Open

Document and add tests: collection conversions of mutable create a copy #11872

lrytz opened this issue Jan 31, 2020 · 4 comments

Comments

@lrytz
Copy link
Member

lrytz commented Jan 31, 2020

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.

@magnolia-k
Copy link

Made a PR about changes to the documentation.
The next step is to add tests, but I'd like some advice on which tests to add, or create a new test file.

@SethTisue
Copy link
Member

SethTisue commented Feb 18, 2020

@Ichoran would scala/scala-collection-laws be a better place than scala/scala for a test like this, cutting across many collection types?

SethTisue pushed a commit to scala/docs.scala-lang that referenced this issue May 6, 2020
scala/bug#11872

In addition, the method introduction was modified to the latest method list.
@SethTisue
Copy link
Member

the doc PR (scala/docs.scala-lang#1643) is now merged

@SethTisue
Copy link
Member

ping @Ichoran about whether this is appropriate for scala-collection-laws?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants