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

18 lines
382 B
Kotlin
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'any{}'"
fun foo(list: List<String>, p: Int) {
var found: Boolean
if (p > 0) {
found = false
println("Starting the search")
<caret>for (s in list) {
if (s.length > 0) {
found = true
break
}
}
}
else {
found = true
}
}