interface Foo {} fun test(obj: Any) { if (obj is Foo) { consume(obj) } } fun consume(obj: Foo) {}