class C { fun foo() {} } fun test(a: C?, nn: () -> Nothing?) { a ?: nn() a.foo() a ?: return a.foo() }