Change Signature: Introduce variable for expression which can't be safely copied in the course of argument substitution

This commit is contained in:
Alexey Sedunov
2015-04-27 15:39:55 +03:00
parent 14f63cdce5
commit 7831e75955
17 changed files with 267 additions and 42 deletions
@@ -8,9 +8,13 @@ class A(val a: Int) {
}
fun test() {
A(1).foo(A(1).a + A(2).a)
val a = A(1)
val a1 = A(2)
a.foo(a.a + a1.a)
with(A(1)) {
foo(a + A(2).a)
this.foo(a + A(2).a)
val a1 = A(2)
foo(this.a + a1.a)
val a = A(2)
this.foo(this.a + a.a)
}
}