mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 15:54:03 +00:00
21 lines
293 B
Kotlin
Vendored
21 lines
293 B
Kotlin
Vendored
class A {
|
|
companion object
|
|
}
|
|
|
|
object B {
|
|
val A.Companion.foo: X get() = X
|
|
}
|
|
|
|
object X
|
|
|
|
object C {
|
|
operator fun X.invoke() = println("Hello!")
|
|
}
|
|
|
|
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
|
|
|
fun use() = with(C) {
|
|
with(B) {
|
|
A.foo()
|
|
}
|
|
} |