Here we go: ``` @Suppress("UNCHECKED_CAST") fun &l...
# stdlib
r
Here we go:
Copy code
@Suppress("UNCHECKED_CAST")
fun <R> Iterable<*>.filterIsInstanceIndexed(clazz: Class<R>): List<IndexedValue<R>> =
  mapIndexed {i, v -> IndexedValue(i, v)}
    .filter { clazz.isInstance(it.value) } as List<IndexedValue<R>>