package my.pkg
sealed trait MyType
object MyType {
case class SubType1(params...) extends MyType
case object SubType2 extends MyType
...
}
as it doesn’t pollute the package namespace. After doing import my.pkg._ I only get MyType and none of the subtypes. This is helpful if package contains more members, like a similar MyType2 with its own subtypes or any other classes or objects. If I want to have the subtypes directly accessible then I write import my.pkg.MyType._ - that also clearly communicates the intent that I want to work with them.