Recognizing manually incremented index

This commit is contained in:
Valentin Kipyatkov
2016-04-21 13:40:03 +03:00
parent 14e87b1f2c
commit d61daed461
23 changed files with 283 additions and 37 deletions
@@ -0,0 +1,8 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with '+= ...filterNot{}.mapIndexed{}'"
fun foo(list: List<String>, target: MutableCollection<Int>) {
<caret>target += list
.flatMap { it.indices }
.filterNot { it == 10 }
.mapIndexed { i, j -> i + j }
}