An idiom for that would be interesting indeed. Her...
# language-proposals
h
An idiom for that would be interesting indeed. Here is my variant with
if (bar == null)
and without non-local jumps:
Copy code
fun main(args: Array<String>) {
    for (foo in listOf(1, null, 2, 3, null)) {
        val bar: String? = foo?.toString()
        if (bar == null) {
            println("warning")
            continue
        }
        // do something with the non-null value.
        println(bar)
    }
}