Files
kotlin-fork/idea/testData/intentions/loopToCallChain/smartCastNotBroken2.kt.after
T
2016-08-16 17:38:10 +03:00

11 lines
355 B
Plaintext
Vendored

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