Files
kotlin-fork/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken4.kt.after
T

12 lines
434 B
Plaintext
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'map{}.map{}.firstOrNull{}'"
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.map{}.firstOrNull{}'"
fun foo(list: List<String>, o: Any) {
var result: Any? = ""
if (o is CharSequence) {
result = list
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
}
}