Change Signature: Substitute parameter references in default values of call expression arguments

This commit is contained in:
Alexey Sedunov
2015-04-24 20:45:57 +03:00
parent cbbeec3790
commit 14f63cdce5
24 changed files with 549 additions and 24 deletions
@@ -0,0 +1,16 @@
// WITH_DEFAULT_VALUE: false
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
class A(val a: Int) {
fun foo(i: Int): Int {
return i / 2
}
}
fun test() {
A(1).foo(A(1).a + A(2).a)
with(A(1)) {
foo(a + A(2).a)
this.foo(a + A(2).a)
}
}