Files
Ivan Kylchik 156ff92845 [kotlin:testdata] Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive in kotlin test
infrastructure. The main reason behind this change is that
`WITH_STDLIB` directive better describes its meaning,
specifically it will add kotlin stdlib to test's classpath.

GitOrigin-RevId: 73a702b404ed63e728ad85fa750d5d87ce5bc7f4
2021-11-19 19:27:17 +00:00

16 lines
479 B
Kotlin

// WITH_STDLIB
// INTENTION_TEXT: "Replace with 'firstOrNull{}'"
// IS_APPLICABLE_2: false
// AFTER-WARNING: The value 'list.firstOrNull { it.length > 0 }' assigned to 'var result: String? defined in foo' is never used
// AFTER-WARNING: Variable 'result' is assigned but never accessed
fun foo(list: List<String>) {
var result: String? = ""
result = null
<caret>for (s in list) {
if (s.length > 0) {
result = s
break
}
}
}