Simplify for: take into account loop parameter nullability

This commit is contained in:
Mikhail Glukhikh
2016-05-18 18:51:41 +03:00
parent a56248a11a
commit d0fd3dea67
3 changed files with 20 additions and 1 deletions
@@ -0,0 +1,11 @@
// IS_APPLICABLE: false
// WITH_RUNTIME
data class XY(val x: String, val y: String)
fun test(xys: Array<XY?>) {
for (<caret>xy in xys) {
val x = xy?.x
val y = xy?.y
println(x + y)
}
}