class ExtensionExample {
var name: String? = null
fun Any?.toString(): String {
return if (this == null) "Value is null" else "Value is not null"
}
fun foo() {
println(name.toString())
}
}
fun main(args: Array<String>) {
ExtensionExample().foo()
}
Y2xhc3MgRXh0ZW5zaW9uRXhhbXBsZSB7CiAgICB2YXIgbmFtZTogU3RyaW5nPyA9IG51bGwKCiAgICBmdW4gQW55Py50b1N0cmluZygpOiBTdHJpbmcgewogICAgICAgIHJldHVybiBpZiAodGhpcyA9PSBudWxsKSAiVmFsdWUgaXMgbnVsbCIgZWxzZSAiVmFsdWUgaXMgbm90IG51bGwiCiAgICB9CgogICAgZnVuIGZvbygpIHsKICAgICAgICBwcmludGxuKG5hbWUudG9TdHJpbmcoKSkKICAgIH0KfQoKZnVuIG1haW4oYXJnczogQXJyYXk8U3RyaW5nPikgewogICAgRXh0ZW5zaW9uRXhhbXBsZSgpLmZvbygpCn0=