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
@@ -14,7 +14,7 @@ class IteratorsJVMTest {
iterate<Char> { if (index < binary.length()) binary.get(index++) else null }
}
val expected = arrayList(
val expected = arrayListOf(
'0', // fibonacci(0) = 0
'1', // fibonacci(1) = 1
'1', // fibonacci(2) = 1
@@ -25,4 +25,9 @@ class IteratorsJVMTest {
assertEquals(expected, fibonacci().flatMap<Int, Char>(intToBinaryDigits()).take(10).toList())
}
test fun flatMapOnIterator() {
val result = listOf(1, 2).iterator().flatMap { i -> (0..i).iterator()}
assertEquals(listOf(0, 1, 0, 1, 2), result.toList())
}
}