Sealed Classes in Subdirectories

Problem

At the moment, subclasses of sealed classes may only be in the same package as the sealed class. If you have a lot of subclasses, you cannot organize them with packages.

Solution

Allow subclasses to be in child folders of the directory the sealed class is in.

  • /
    • SealedClass.kt
    • SubClass.kt → Currently allowed
    • SubFolder
      • ClassInSubfolder → Not allowed currently, make allowed
1 Like