I have past a lambda today that has a variable which is of unknown type , and inside the when..is condition , the variable can't smart cast to the type in the is condition ... it gives that it is impossible since the variable is a Public Api , is there a workaround to this ?

[![enter image description here](https://i.stack.imgur.com/J07Mo.png)](https://i.stack.imgur.com/J07Mo.png)