Files
kotlin-fork/idea/testData/intentions/loopToCallChain/firstOrNull_assignmentInitialization.kt
T

13 lines
259 B
Kotlin
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'firstOrNull{}'"
fun foo(list: List<String>) {
var result: String? = ""
result = null
<caret>for (s in list) {
if (s.length > 0) {
result = s
break
}
}
}