Scala 3 Enum vs Enumerations

Whats the difference between a scala Enum vs a scala Enumeration?

Also, I could find Enumeration in the scala 3 ref (Enumeration)

but I couldnt find Enum: does anyone have a link?

Enumeration exists since Scala 2 and it’s a mistake, never ever use it.

enum is a keyword added in Scala 3 that is just sugar syntax for a common pattern in Scala 2 to define ADTs (and thus enums) using sealed traits and case classes / objects

3 Likes



The above are from Scala 3 by Example - Algebraic Data Types for Domain Driven Design - …

2 Likes