Remove bogus filterIsInstance* on strings.

This commit is contained in:
Ilya Ryzhenkov
2014-04-15 16:03:47 +04:00
committed by Andrey Breslav
parent 6562ee4967
commit 9a7758bf4e
2 changed files with 2 additions and 17 deletions
@@ -345,13 +345,6 @@ public fun <T, R : T> Stream<T>.filterIsInstance(klass: Class<R>): Stream<T> {
return FilteringStream(this, true, { klass.isInstance(it) })
}
/**
* Returns a list containing all elements that are instances of specified class
*/
public fun <R : Char> String.filterIsInstance(klass: Class<R>): List<R> {
return filterIsInstanceTo(ArrayList<R>(), klass)
}
/**
* Appends all elements that are instances of specified class to the given *destination*
*/
@@ -376,14 +369,6 @@ public fun <T, C : MutableCollection<in R>, R : T> Stream<T>.filterIsInstanceTo(
return destination
}
/**
* Appends all elements that are instances of specified class to the given *destination*
*/
public fun <C : MutableCollection<in R>, R : Char> String.filterIsInstanceTo(destination: C, klass: Class<R>): C {
for (element in this) if (klass.isInstance(element)) destination.add(element as R)
return destination
}
/**
* Sorts array or range in array inplace
*/
@@ -78,7 +78,7 @@ fun specialJVM(): List<GenericFunction> {
typeParam("C : MutableCollection<in R>")
typeParam("R : T")
returns("C")
exclude(ArraysOfPrimitives)
exclude(ArraysOfPrimitives, Strings)
body {
"""
for (element in this) if (klass.isInstance(element)) destination.add(element as R)
@@ -96,7 +96,7 @@ fun specialJVM(): List<GenericFunction> {
return filterIsInstanceTo(ArrayList<R>(), klass)
"""
}
exclude(ArraysOfPrimitives)
exclude(ArraysOfPrimitives, Strings)
doc(Streams) { "Returns a stream containing all elements that are instances of specified class" }
returns(Streams) { "Stream<T>" }