Supported other patterns for mapNotNull

This commit is contained in:
Valentin Kipyatkov
2016-04-22 11:48:10 +03:00
parent a6132c7db9
commit 8c7cdf1bf8
5 changed files with 39 additions and 0 deletions
@@ -0,0 +1,7 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'mapIndexedNotNull{}.mapTo(){}'"
fun foo(list: List<String?>, target: MutableList<String>) {
<caret>list
.mapIndexedNotNull { index, s -> s?.substring(index)?.length }
.mapTo(target) { it.toString() }
}