Files
kotlin-fork/idea/testData/refactoring/introduceParameter/substituteDoubleReceiver.kt.after
T
2015-08-27 12:01:08 +03:00

20 lines
341 B
Plaintext
Vendored

// 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() {
val a1 = A(1)
foo(a + a1.a)
}
}
fun test() {
val t = with(A(1)) {
val a1 = A(2)
foo(a + a1.a)
}
}