Skip to content

Commit

Permalink
Improve map test coverage (#2980)
Browse files Browse the repository at this point in the history
Co-authored-by: Alejandro Serrano <[email protected]>
  • Loading branch information
abendt and serras authored Mar 24, 2023
1 parent 9f24aab commit cc95e40
Show file tree
Hide file tree
Showing 4 changed files with 658 additions and 72 deletions.
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

0 comments on commit cc95e40

Please sign in to comment.