Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
inline fun <reified T>
Iterable<*>.filterIsInstance(): List<T>
val destination = mutableListOf<T>()
for (element in this) {
if (element is T) {
destination.add(element)
}
}
return destination
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.