Files
kotlin-fork/idea/testData/intentions/loopToCallChain/maxMin/KT14210.kt.after2
T
2021-04-07 07:49:23 +03:00

10 lines
289 B
Plaintext
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'filter{}.maxOrNull()'"
// INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.maxOrNull()'"
fun f(list: List<Int>) {
val <caret>result = list
.asSequence()
.filter { it % 2 == 0 }
.maxOrNull()
?: -1
}