Merge remote-tracking branch 'origin/master' into incremental

This commit is contained in:
Evgeny Gerashchenko
2014-06-19 11:43:11 +04:00
89 changed files with 1305 additions and 808 deletions
@@ -0,0 +1,25 @@
package foo
fun test():Any {
val a: Any = "OK"
val f: Any =
if (true) {
when {
false -> "1"
((a as? String)?.size ?: 0 > 0) -> a
else -> "2"
}
}
else {
"3"
}
return f
}
fun box(): Boolean {
var result = test()
return result == "OK";
}
+6
View File
@@ -543,6 +543,9 @@
},
iterator: function () {
return new Kotlin.RangeIterator(this.start, this.end, this.increment);
},
isEmpty: function () {
return this.start > this.end;
}
});
@@ -554,6 +557,9 @@
}, {
iterator: function () {
return new Kotlin.RangeIterator(this.start, this.end, this.increment);
},
isEmpty: function() {
return this.increment > 0 ? this.start > this.end : this.start < this.end;
}
});
@@ -0,0 +1,15 @@
package foo
fun box(): Boolean {
var result = false
var i = 1
do
when (i) {
1 -> result = true
else -> result = false
}
while (i==0)
return result;
}
@@ -0,0 +1,13 @@
package foo
fun box(): Boolean {
var result = false
for (i in array(1))
when (i) {
1 -> result = true
else -> result = false
}
return result;
}
@@ -0,0 +1,13 @@
package foo
fun box(): Boolean {
var result = false
var i = 1
if (i==1)
when (i) {
1 -> result = true
else -> result = false
}
return result;
}
@@ -0,0 +1,14 @@
package foo
fun box(): Boolean {
var result = false
var i = 1
while(i==1)
when (i) {
1 -> { result = true; break }
else -> result = false
}
return result;
}