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

12 lines
336 B
Plaintext
Vendored

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