class A { fun foo() {} } fun A.bar() {} fun A?.buzz() {} fun test(a : A?) { a.foo() // error a.bar() // error a.buzz() a?.foo() a?.bar() a?.buzz() } fun A.test2() { foo() bar() buzz() this.foo() this.bar() this.buzz() this?.foo() // warning this?.bar() // warning this?.buzz() // warning } fun A?.test3() { foo() // error bar() // error buzz() this.foo() // error this.bar() // error this.buzz() this?.foo() this?.bar() this?.buzz() }