// KT-49992 import kotlin.reflect.KFunction0 open class A { private val x: String? = null fun test0() { x this.x } open class Nested : A() { private val y: String? = null fun test1(): String? = x fun test2(): String? = this.x class NestedInNested : Nested() { fun test20(): String? = y fun test21(): String? = this.y } inner class InnerInNested : Nested() { fun test23(): String? = y fun test24(): String? = this.y } } interface I { fun test401(): KFunction0 } open inner class Inner : A(), I { private val y: String? = null fun test3(): String? = x fun test4(): String? = this.x inner class InnerInInner : Inner() { fun test40(): String? = x fun test41(): String? = y } private fun test400() { } override fun test401(): KFunction0 { return this::test400 } } fun test5() { object : A() { fun local() { x this.x } inner class NestedInAnonymous() { fun test50(): String? = x } } } } fun A.extensionFun(): String? = this.x abstract class B> { protected abstract val thisBuilder: T private val x: String? = null fun test6(obj: Any?) = thisBuilder.apply { obj?.let { this.x } } }