You can use an object as a descendant of a sealed class. Data objects don’t exist because the methods that the compiler generates for a data class don’t make sense for an object.
Yes, you can do that. The default implementation of java.lang.Object.hashCode() used by all classes that don’t override it works perfectly fine in this scenario.
However the default implementation of toString makes an object implementing sealed class differ from the data class, see this issue for details: https://youtrack.jetbrains.com/issue/KT-4107
Ok, you’re right in this case. But except from the already mentioned toString implementation, the usual object doesn’t have component1..n methods. I’m just wondering why Scala does have case objects and Kotlin does not. Most things in Scala have a proper reason.
The componentN methods are not an implementation of any interface, so you can’t really use a destructuring declaration with an instance of a sealed class without knowing the specific implementation (unless you explicitly declare all componentN methods as abstract methods in the sealed class definition). And using a destructuring declaration on an object knowing that it is an object doesn’t seem to be particularly useful, because objects rarely contain mutable data.