``` object RTMMessages { sealed class Message(...
# announcements
b
Copy code
object RTMMessages {
    sealed class Message(val id: Long, val type: String, val channel: String){
        class Typing() : Message(id, "typing", channel)
    }
}
d
I’m not sure what you’re trying to do with this code, could you elaborate a bit and I’ll see if I can suggest something?
👆 1
b
I'm trying to create a message hierarchy for the Slack RTM payloads
so there will be several different kinds of
Message
and it'd be nice to have the compiler cover the "oh you forgot to include this type" stuff
this seems to be the way to do it
d
Hmmm, okay. I would probably just have used sealed classes. If you’re forced to construct the base class it makes it hard to forget something.
b
am I not using sealed classes?
d
Oh, that’s my mistake, I’m used to sealed classes needing to have their subclasses nested.