Supported mapIndexedTo and mapIndexedNotNullTo

This commit is contained in:
Valentin Kipyatkov
2016-04-22 12:12:12 +03:00
parent 2652ea4233
commit b6e05e058e
10 changed files with 61 additions and 22 deletions
@@ -1,8 +1,8 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with '+= ...filterNot{}.mapIndexed{}'"
// INTENTION_TEXT: "Replace with 'flatMap{}.filterNot{}.mapIndexedTo(){}'"
fun foo(list: List<String>, target: MutableCollection<Int>) {
<caret>target += list
<caret>list
.flatMap { it.indices }
.filterNot { it == 10 }
.mapIndexed { i, j -> i + j }
.mapIndexedTo(target) { i, j -> i + j }
}