mg6maciej
05/23/2017, 11:04 AMval localVal = nullableExpr
if (localVal != null && localVal.property == "x") {
// localVal is guaranteed in this context
doSomething(with = localVal)
} else {
// localVal is nonexistant in this context
println("nullableExpr was null")
}
with a problem (IMHO minor) that localVal is visible in else.
And the second example where you even said that Kotlin does much better than Swift.
And now this third example, which I have no idea what is doing as there are no relations between these comma-separated expressions.
Any real example where Swift shines and you have problems translating it to Kotlin?