Name class classes in Scala
2 answers
I would not recommend putting case classes in their abstract superclass, because nested classes are path dependent in Scala. If anything, you can put them inside a companion object.
abstract class MyTree
object MyTree {
case class Node (...) extends MyTree
case class Leaf (...) extends MyTree
}
(note: I haven't tested this ...)
+2
a source to share