fun test(a: Any) { if (a !is Foo) { return } check(a.process()) } fun check(condition: Boolean) {} interface Foo { fun process(): Boolean }