Pre-SIP: sealed enumerating allowed sub-types

A less scary alternative might be

sealed trait ADT
case class A(...) extends ADT with AImpl
case class B(...) extends ADT with BImpl

Other file:

private[foo] trait AImpl { this: A => 
  // lots of implementation code
}
7 Likes