I’m pleased to see that Kotlin has not adopted the Java way when it comes to .contains() in collections, i.e. instead of allowing Object as an argument regardless of the generic type signature of the collection, it is restricted to accepting only compatible types.
However, == does not have this behaviour, I can compare two objects of different unrelated subclasses without seeing errors or even inspections/warnings in IntelliJ. As a result, we’ve recently had some production issues as we migrated from one type to another, and some equality checks started to simply always return false.
Is there a particular reason for this design choice? And is there a way in IntelliJ or other code analysis tools to find all such usages of == - or plans to support some?