KT-740: Make sure that assign and increment operations compute receiver only once:

- Increment operation on property.
This commit is contained in:
unknown
2012-03-09 16:13:21 +04:00
parent 3841227868
commit 295b38bf32
20 changed files with 505 additions and 95 deletions
@@ -0,0 +1,26 @@
package foo
var c = 0
class A() {
var p = 0;
{
c++;
}
}
fun box() : Boolean {
++A().p
if (c != 1) {
return false;
}
--A().p
if (c != 2) {
return false;
}
return true
}
fun main(args : Array<String>) {
println(box())
}