Skip to content

Commit 57a0f17

Browse files
committed
address review comments
1 parent a7d1e33 commit 57a0f17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: docs/_spec/05-classes-and-objects.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -970,8 +970,8 @@ enum Option[+T]:
970970
An enum class is represented as a `sealed abstract` class that extends the `scala.reflect.Enum` trait.
971971

972972
Enum cases are represented as follows:
973-
- a class enum case is mapped to a `case class` member of enum class' companion object,
974-
- a singleton enum case is mapped to a `val` member of the enum class' companion object, implemented by a local class definition which may be shared between cases.
973+
- a class enum case is mapped to a `case class` member of the enum class' companion object,
974+
- a singleton enum case is mapped to a `val` member of the enum class' companion object, implemented by a local class definition. Whether that local class is shared with other singleton cases, and which ones, is left as an implementation detail.
975975

976976
###### Precise rules
977977
The `scala.reflect.Enum` trait defines a single public method, `ordinal`:
@@ -994,7 +994,7 @@ Explicit `extends` clauses must be provided in the following cases, where rules
994994

995995
1. An `enum` definition
996996
```scala
997-
enum ´E´ <type-params> <value-params> { <defs> <cases> }
997+
enum ´E´ <type-params> <value-params> extends <parents> { <defs> <cases> }
998998
```
999999
expands to a `sealed abstract` class that extends the `scala.reflect.Enum` trait and an associated companion object that contains the defined cases, expanded according to rules (2 - 8).
10001000
The enum class starts with a compiler-generated import that imports the names `<caseIds>` of all cases so that they can be used without prefix in the class.

0 commit comments

Comments
 (0)