Postpone companion object field visibility

Have to reconsider this issue because of interface companion objects.
This commit is contained in:
Dmitry Petrov
2018-09-25 17:47:54 +03:00
parent 792ff3c39e
commit 0dd04c3424
15 changed files with 241 additions and 3 deletions
@@ -0,0 +1,16 @@
// LANGUAGE_VERSION: 1.3
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()