stdlib: Uncomment extensions with reified parameters

This commit is contained in:
Ilya Matveev
2017-04-12 18:23:20 +07:00
committed by ilmat192
parent 6fc7c3495a
commit 6549dda5fb
2 changed files with 5 additions and 11 deletions
@@ -952,8 +952,6 @@ public inline fun <T, C : MutableCollection<in T>> Iterable<T>.filterIndexedTo(d
/**
* Returns a list containing all elements that are instances of specified type parameter R.
*/
/*
@FixmeReified
public inline fun <reified R> Iterable<*>.filterIsInstance(): List<@kotlin.internal.NoInfer R> {
return filterIsInstanceTo(ArrayList<R>())
}
@@ -965,7 +963,7 @@ public inline fun <reified R, C : MutableCollection<in R>> Iterable<*>.filterIsI
for (element in this) if (element is R) destination.add(element)
return destination
}
*/
/**
* Returns a list containing all elements not matching the given [predicate].
@@ -941,22 +941,18 @@ public inline fun <T, C : MutableCollection<in T>> Sequence<T>.filterIndexedTo(d
/**
* Returns a sequence containing all elements that are instances of specified type parameter R.
*/
@FixmeReified
public inline fun <reified R> Sequence<*>.filterIsInstance(): Sequence<@kotlin.internal.NoInfer R> {
//@Suppress("UNCHECKED_CAST")
//return filter { it is R } as Sequence<R>
TODO()
@Suppress("UNCHECKED_CAST")
return filter { it is R } as Sequence<R>
}
/**
* Appends all elements that are instances of specified type parameter R to the given [destination].
*/
@FixmeReified
@Suppress("UNUSED_PARAMETER")
public inline fun <reified R, C : MutableCollection<in R>> Sequence<*>.filterIsInstanceTo(destination: C): C {
//for (element in this) if (element is R) destination.add(element)
//return destination
TODO()
for (element in this) if (element is R) destination.add(element)
return destination
}
/**