Skip to content

Commit 86fc594

Browse files
committed
Mention that enum declarations are implicitly final
1 parent 73d7241 commit 86fc594

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
663+
at least as strong as the restrictions implied by that modifier. This
664+
ensures that we can specify those errors without mentioning an exception
665+
for enum 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)