Skip to content

Commit

Permalink
Make adjustments following issue #4015 (#4103)
Browse files Browse the repository at this point in the history
Introduce compile-time errors about augmentation of "built-in" properties of an `enum` declaration, following issue #4015.
  • Loading branch information
eernstg authored Sep 26, 2024
1 parent b8c7422 commit 13277c3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion working/augmentation-libraries/feature-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,15 @@ It is a **compile-time error** if:

* An `external` variable is augmented with an `abstract` variable.

### Augmenting enum values
### Augmenting enum members

Some enum members can not be augmented: It is a compile-time error if an
augmenting declaration in an enum declaration (introductory or augmenting)
has the name `values`, `index`, `hashCode`, or `==`.

*It has always been an error for an enum declaration to declare a member
named `index`, `hashCode`, `==`, or `values`, and this rule just clarifies
that this error is applicable for augmenting declarations as well.*

Enum values can _only_ be augmented by enum values, and the implicit getter
introduced by them is not augmentable. The only thing you are allowed to do
Expand Down

0 comments on commit 13277c3

Please sign in to comment.