15 lines
230 B
Kotlin
Vendored
15 lines
230 B
Kotlin
Vendored
inline fun on(body: () -> Any) = body().toString()
|
|
|
|
class A {
|
|
fun test() = foo()
|
|
|
|
private companion object {
|
|
private fun foo() = on { this }
|
|
|
|
override fun toString() = "OK"
|
|
}
|
|
}
|
|
|
|
|
|
fun box() = A().test()
|