Change Signature: Introduce variable for expression which can't be safely copied in the course of argument substitution
This commit is contained in:
+7
-3
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user