open class Foo fun bar(): Foo? { return null } fun resolveMe() { val x = bar() }