Supported case when result variable initialization is not right before the loop
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'filterIndexed{}.map{}'"
|
||||
import java.util.*
|
||||
|
||||
fun foo(list: List<String>): List<Int> {
|
||||
val <caret>result = list
|
||||
.filterIndexed { i, s -> s.length > i }
|
||||
.map { it.length }
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user