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