Files
kotlin-fork/idea/testData/intentions/loopToCallChain/firstOrNull/let2.kt.after
T
2016-08-23 22:47:42 +03:00

11 lines
290 B
Plaintext
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'firstOrNull{}'"
// IS_APPLICABLE_2: false
fun foo(list: List<String>) {
val <caret>result: String? = list
.firstOrNull { it.length > 0 }
?.let { it.substring(0, it.length - 1) }
}
fun bar(s: String): String = s