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