Files
kotlin-fork/idea/testData/refactoring/changeSignature/AddPropertyReceiverBefore.kt
T
Alexey Sedunov 2ff63d37c2 Change Signature: Property support
#KT-6599 Fixed
2015-07-03 18:38:01 +03:00

26 lines
356 B
Kotlin
Vendored

public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
open class A {
open var <caret>p: Int = 1
}
class B: A() {
override var p: Int = 2
}
fun test() {
with(A()) {
val t = p
p = 1
}
with(B()) {
val t = p
p = 2
}
with(J()) {
val t = getP()
setP(3)
}
}