Miro
Miro

Reputation: 1806

Why Scala doesn't have enum type and what are benefits of current design?

What is the reason why they decided not to implement enum type in Scala ? What are benefits of current language design (defining object and extending scala.Enumeration instead of creating new enum type ) ?

Upvotes: 5

Views: 309

Answers (1)

om-nom-nom
om-nom-nom

Reputation: 62835

I don't see any reasonable benefits of Enumeration in it's current state and tend to think it is design flaw that scala community is trying to overcome. It is not easy, but I guess this is definitely will be done in next two major scala versions. In all scala code I've seen sealed object hierarchy was given a preference.

Upvotes: 6

Related Questions