fun maybeFoo(): String? { return "foo" } fun main(args: Array) { val foo = maybeFoo() if (foo != null) foo.length else null }