Scala and the JVM · Part 19
Escaping Boolean hell and making Illegal States Unrepresentable in Scala 2.13
A sealed trait removes impossible states from a model, but five details decide whether it holds: constructors, exhaustivity warnings, wildcards, Scala 2 inference and secrets in toString. I compiled each one on Scala 2.13.18.