fun getT(): T = null!! class Test { private val i: I = getT() init { apply(i) apply(this.i) } fun apply(i: I) {} fun test() { apply(i) apply(this.i) with(Test()) { apply(i) // resolved to this@Test.i apply(this.i) apply(this@with.i) apply(this@Test.i) } } fun test(t: Test) { t.apply(t.i) } companion object { fun test(t: Test) { t.apply(t.i) } } } fun test(t: Test) { t.apply(t.i) }