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

Improve map test coverage #2980

Merged
merged 23 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,9 @@ public fun <K, A> Map<K, Option<A>>.filterOption(): Map<K, A> =
/**
* Returns a Map containing all elements that are instances of specified type parameter R.
*/
@Suppress("UNCHECKED_CAST")
public inline fun <K, reified R> Map<K, *>.filterIsInstance(): Map<K, R> =
mapNotNull { it as? R }
filterValues { it is R } as Map<K, R>

/**
* Combines two structures by taking the union of their shapes and using Ior to hold the elements.
Expand Down
Loading