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.