don't generate two 'flatMap' methods(*) for Iterator

* with the same erased signature
 #KT-3373 Fixed
This commit is contained in:
Svetlana Isakova
2013-03-22 20:07:23 +04:00
parent d0e736e5a6
commit 362770c9b1
8 changed files with 23 additions and 25 deletions
@@ -35,6 +35,13 @@ public inline fun <T, R> Collection<T>.map(transform : (T) -> R) : List<R> {
return mapTo(ArrayList<R>(), transform)
}
/**
* Returns the result of transforming each element to one or more values which are concatenated together into a single list
*/
public inline fun <T, R> Collection<T>.flatMap(transform: (T)-> Iterable<R>) : List<R> {
return flatMapTo(ArrayList<R>(), transform)
}
/**
* Returns a list containing the first *n* elements
*/
@@ -90,13 +90,6 @@ public inline fun <T, R, C: MutableCollection<in R>> Iterable<T>.mapTo(result: C
return result
}
/**
* Returns the result of transforming each element to one or more values which are concatenated together into a single list
*/
public inline fun <T, R> Iterable<T>.flatMap(transform: (T)-> Iterable<R>) : List<R> {
return flatMapTo(ArrayList<R>(), transform)
}
/**
* Returns the result of transforming each element to one or more values which are concatenated together into a single collection
*/
@@ -90,13 +90,6 @@ public inline fun <T, R, C: MutableCollection<in R>> Iterator<T>.mapTo(result: C
return result
}
/**
* Returns the result of transforming each element to one or more values which are concatenated together into a single list
*/
public inline fun <T, R> Iterator<T>.flatMap(transform: (T)-> Iterable<R>) : List<R> {
return flatMapTo(ArrayList<R>(), transform)
}
/**
* Returns the result of transforming each element to one or more values which are concatenated together into a single collection
*/