fun getT(): T = null!! class Test { private var i: I = getT() private val j: I init { j = getT() i = getT() this.i = getT() } fun test() { i = getT() this.i = getT() with(Test()) { i = getT() // K1: this@Test.i, K2: this@with.i, see KT-55446 this.i = getT() this@with.i = getT() this@Test.i = getT() } } fun test(t: Test) { t.i = getT() } companion object { fun test(t: Test) { t.i = getT() } } } fun test(t: Test) { t.i = getT() }