Coerce loop body to Unit.

This commit is contained in:
Dmitry Petrov
2016-09-21 12:33:37 +03:00
parent 291d535de7
commit 663eb21990
4 changed files with 64 additions and 0 deletions
@@ -0,0 +1,10 @@
fun box(): String {
val a = DoubleArray(5)
val x = a.iterator()
var i = 0
while (x.hasNext()) {
if (a[i] != x.next()) return "Fail $i"
i++
}
return "OK"
}