Skip to content
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

Extensions to copy maps #13

Closed
ilya-g opened this issue May 18, 2016 · 4 comments
Closed

Extensions to copy maps #13

ilya-g opened this issue May 18, 2016 · 4 comments
Assignees
Labels

Comments

@ilya-g
Copy link
Member

ilya-g commented May 18, 2016

Discussions about the Extensions to copy maps will be held here.

@ilya-g ilya-g self-assigned this May 18, 2016
@ilya-g ilya-g added the stdlib label May 23, 2016
@ilya-g ilya-g changed the title stdlib: Extensions to copy maps Extensions to copy maps May 23, 2016
ilya-g added a commit that referenced this issue Jul 14, 2016
@voddan
Copy link
Contributor

voddan commented Aug 10, 2016

There is an empty cell in the reference table for Iterable<Pair<K, V>>.toMutableMap(): MutableMap<K, V>. There is a similar function for an immutable map Iterable<Pair<K, V>>.toMap(): Map<K, V>. Would not it be logical to introduce the mutable one?

@ilya-g
Copy link
Member Author

ilya-g commented Aug 10, 2016

@voddan Iterable<Pair<K, V>>.toMap(destination: M) covers that case and it seems to be required not so often. We have it in the "future advancements" section :)

ilya-g added a commit that referenced this issue Dec 4, 2016
@ilya-g ilya-g closed this as completed Mar 15, 2017
@binkley
Copy link

binkley commented Apr 5, 2017

I'm glad there's a toMutableMap, toMap, etc. Disappointed there is not a simple copy which knows the map type and "does the right thing" (akin to JDK clone without the downsides).

@ilya-g
Copy link
Member Author

ilya-g commented Apr 6, 2017

@binkley This is not possible in general case, see the discussion in this issue: KT-11221

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

No branches or pull requests

3 participants