Scala

Scala

Made by DeepSource

Sealed entity has no descendants SC-W1079

Bug risk
Critical

The modifier sealed means that the descendants of a entity may be inherited only if they're declared in the same file as that of the entity. However, in your case, the marked entity does not have any descendants. In such cases, having the sealed modifier maybe confusing. Either you forgot to declare the entity's descendants, or, the modifier sealed is not ideal for your use case.

Bad Practice

sealed trait ProgrammingLanguage

Recommended

// Alternative 1: declare descendants
sealed ProgrammingLanguage 
case object Scala extends ProgrammingLanguage

// Alternative 2: drop the `sealed` modifier
trait ProgrammingLanguage