d13ac6b5a4
#KT-9697 In Progress
52 lines
759 B
Kotlin
Vendored
52 lines
759 B
Kotlin
Vendored
package test
|
|
|
|
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
|
|
|
class A {
|
|
class X {
|
|
|
|
}
|
|
|
|
companion object {
|
|
class Y
|
|
|
|
fun foo(n: Int) {}
|
|
|
|
val bar = 1
|
|
|
|
fun Int.extFoo(n: Int) {}
|
|
|
|
val Int.extBar: Int get() = 1
|
|
}
|
|
|
|
object O {
|
|
class Y
|
|
|
|
fun foo(n: Int) {}
|
|
|
|
val bar = 1
|
|
|
|
fun Int.extFoo(n: Int) {}
|
|
|
|
val Int.extBar: Int get() = 1
|
|
}
|
|
|
|
class <caret>B {
|
|
fun test() {
|
|
X()
|
|
|
|
Y()
|
|
foo(bar)
|
|
1.extFoo(1.extBar)
|
|
|
|
O.Y()
|
|
O.foo(O.bar)
|
|
|
|
with (O) {
|
|
Y()
|
|
foo(bar)
|
|
1.extFoo(1.extBar)
|
|
}
|
|
}
|
|
}
|
|
} |