How to extend existing enumerations objects in Scala?

Viewed 3593

I'm wondering if you can extend already existing enumerations in Scala. For example:

object BasicAnimal extends Enumeration{
    type BasicAnimal = Value
    val Cat, Dog = Value   
}

Can this be extended something like this:

object FourLeggedAnimal extends BasicAnimal{
    type FourLeggedAnimal = Value
    val Dragon = Value
}

Then, the elements in FourLeggedAnimal would be Cat, Dog and Dragon. Can this be done?

2 Answers
Related