@@ -514,9 +514,7 @@ Many combinations don't make sense:
514
514
* ` sealed ` types cannot be constructed so it's redundant to combine with
515
515
` abstract ` .
516
516
* ` sealed ` types cannot be extended or implemented, so it's redundant to
517
- combine with ` final ` .
518
- * ` sealed ` types cannot be extended so it contradicts ` base ` .
519
- * ` sealed ` types cannot be implemented, so it contradicts ` interface ` .
517
+ combine with ` final ` , ` base ` , or ` interface ` .
520
518
* ` sealed ` types cannot be mixed in outside of their library, so it
521
519
contradicts ` mixin ` on a class. * It's useful to allow ` sealed ` on a mixin
522
520
declaration because the mixin can be applied within the same library.
@@ -849,11 +847,14 @@ intents.*
849
847
850
848
### Enum classes
851
849
852
- The class introduced by an ` enum ` declaration is considered ` final ` .
850
+ The class introduced by an ` enum ` declaration is considered ` final ` for any purpose
851
+ where a class modifier is required.
853
852
854
- Since the class cannot have any subclasses, the modifier does not prevent
855
- any otherwise allowed operation, and adding it ensures that the enum class
856
- satisfies any requirements introduced by its super-interfaces.
853
+ The behavior of ` enum ` declarations is unchanged. Since an ` enum ` class cannot have
854
+ any subclasses, the modifier would not prevent any otherwise allowed operation.
855
+ The implicit ` final ` also does not imply fewer restrictions than ` enum ` declarations
856
+ would otherwise have. The modifier is applied only to automatically satisfy any
857
+ requirements introduced by super-interfaces.
857
858
858
859
### Anonymous mixin applications
859
860
@@ -909,8 +910,8 @@ the anonymous class can mostly be ignored, since it satisfies all possible requi
909
910
of its superclasses, while still propagating those requirements to its subclass.
910
911
Treating the anonymous class as having these modifiers allows the algorithms
911
912
used to check that restrictions are satisfied, and for the “reopen” lint described below,
912
- to treat the anonymouse mixin application class as any other class, without needing
913
- special cases.
913
+ to treat the anonymous mixin application class as any other class, without needing
914
+ special cases, and without adding any new restrictions. .
914
915
915
916
### ` @reopen ` lint
916
917
@@ -956,7 +957,7 @@ non-breaking.
956
957
declarations in pre-feature libraries can ignore * some*
957
958
` base ` , ` interface ` and ` final ` modifiers on * some* declarations
958
959
in platform libraries, and to mix in non-` mixin ` classes from platform libraries,
959
- as long as those classes has ` Object ` as superclass and declares no constructors.
960
+ as long as such a class has ` Object ` as superclass and declares no constructors.
960
961
Instead, users will only have to abide by those restrictions
961
962
when they upgrade their library's language version.
962
963
_ It will still not be possible to, e.g., extend or implement the ` int ` class,
0 commit comments