My Dilemma Using Sealed Class in Kotlin

Sealed class in Kotlin is very useful. You can create a restricted class hierarchies. I'm using it to define a state in finite state machine mechanism and create a redux like state machine.

Kotlin give you two option to declare a sealed class subclasses. You can make it nested in the parent class like this

sealed class FeedAction {  
    class ShowFeed(val feeds: List<Feed>) : FeedAction()
    class ShowLoading(val isShow: Boolean): FeedAction()
}

Or in Kotlin 1.1 you can make it more readable and relatively nicer code by declare the subclass outside the sealed class as long as it in the same file

// This is declared in the same file. Ex: FeedActions.kt
sealed class FeedAction  
class ShowFeed(val feeds: List<Feed>) : FeedAction()  
class ShowLoading(val isShow: Boolean): FeedAction()  

Because the subclasses is outside the parent class, it also give you simpler import syntax. You don't have to bring FeedAction with you if you want to use ShowFeed

The only problem with this approach is that the icon shown in IntelliJ or AS file explorer is not symmetrical and it driving me nuts!!!

This fucking problem

Oh why i'm so obsessed with this kind of problems.
So that's my condition with sealed class in Kotlin, what's yours?

Cao 👋