Skip to content

Commit bac0586

Browse files
authored
Mention that enums are implicitly final (#2999)
1 parent dcd7ca2 commit bac0586

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

accepted/future-releases/class-modifiers/feature-specification.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,13 @@ we can specify the restrictions imposed by modifiers._
657657

658658
### Basic restrictions
659659

660+
With respect to compile-time errors caused by missing required class
661+
modifiers, every enum declaration is considered to have the modifier
662+
`final`. *An enum declaration is always subject to restrictions which are at
663+
least as strong as the restrictions implied by that modifier. This ensures
664+
that we can specify those errors without mentioning an exception for enum
665+
declarations in every rule.*
666+
660667
It's a compile-time error if:
661668

662669
* A declaration depends directly on a `sealed` declaration from another

0 commit comments

Comments
 (0)