Initial support for indexed transformations

This commit is contained in:
Valentin Kipyatkov
2016-04-20 20:00:41 +03:00
parent 955e1166fd
commit 14e87b1f2c
26 changed files with 311 additions and 46 deletions
@@ -0,0 +1,8 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'mapIndexed{}.mapIndexed{}.firstOrNull{}'"
fun foo(list: List<String>): Int? {
<caret>return list
.mapIndexed { index, s -> s.length * index }
.mapIndexed { index, x -> x + index }
.firstOrNull { it > 0 }
}