Use common instance receiver generation logic for 'this' expression

Otherwise it would skip private companion object accessor generation.
This commit is contained in:
Dmitry Petrov
2018-09-25 15:23:55 +03:00
parent c4337f753e
commit 7949ac1080
7 changed files with 75 additions and 23 deletions
@@ -0,0 +1,17 @@
// !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField
// IGNORE_BACKEND: JS, JS_IR, JVM_IR
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()