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

9 lines
293 B
Plaintext
Vendored

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