KT-817 Wrong code on prefix increment operators.

This commit is contained in:
pTalanov
2012-03-13 17:41:08 +04:00
parent 515b701383
commit af690fb02a
6 changed files with 52 additions and 64 deletions
@@ -36,7 +36,7 @@ fun box() : String {
if (c0 != 2) {
return "3"
}
if (c1 != 2) {
if (c1 != 3) {
return "4"
}
if (c2 != 1) {
@@ -46,14 +46,11 @@ fun box() : String {
if (c0 != 3) {
return "6"
}
if (c1 != 3) {
if (c1 != 5) {
return "7"
}
if (c2 != 2) {
return "8"
}
return "OK"
}
@@ -0,0 +1,21 @@
package foo
class Range() {
val reversed = false;
val start = 0;
var count = 10;
fun next() = start + if (reversed) -(--count) else (--count);
}
fun box() : Boolean {
val r = Range()
if (r.next() != 9) {
return false;
}
if (r.next() != 8) {
return false;
}
return true;
}