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

13 lines
371 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>for (s in list) {
val a = s.length + (o as String).capitalize().hashCode()
val x = a * o.length
if (x > 1000) return x
}
return null
}
return 0
}