Skip to content

Commit 13277c3

Browse files
authored
Make adjustments following issue #4015 (#4103)
Introduce compile-time errors about augmentation of "built-in" properties of an `enum` declaration, following issue #4015.
1 parent b8c7422 commit 13277c3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

working/augmentation-libraries/feature-specification.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,15 @@ It is a **compile-time error** if:
726726

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

729-
### Augmenting enum values
729+
### Augmenting enum members
730+
731+
Some enum members can not be augmented: It is a compile-time error if an
732+
augmenting declaration in an enum declaration (introductory or augmenting)
733+
has the name `values`, `index`, `hashCode`, or `==`.
734+
735+
*It has always been an error for an enum declaration to declare a member
736+
named `index`, `hashCode`, `==`, or `values`, and this rule just clarifies
737+
that this error is applicable for augmenting declarations as well.*
730738

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

0 commit comments

Comments
 (0)