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

13 lines
279 B
Kotlin
Vendored

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