fun Any?.foo() = println(this ?: "Sadly, this is null") fun main(args: Array) { val x: Int? = null val y: Int? = 3 x.foo() y.foo() null.foo() }