Skip to content

Commit 0e320bd

Browse files
authored
Update augmentation library spec for class modifiers (#2917)
I removed the line about `abstract` and instead chose to say that all class modifiers must be present on both the augmentation type and the original type. This is I think consistent with the requirement to duplicate the type parameters, and it ensures people won't be confused about the modifiers on a class when looking at only the augmentation. Open for debate certainly though! We could go the opposite direction and drop the `class/mixin/enum` keywords from augmentation libraries, as well as duplicate type parameters, thus eliminating all redundant information.
1 parent e2703f8 commit 0e320bd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

working/augmentation-libraries/feature-specification.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,15 +313,16 @@ It is a compile-time error if:
313313
* The augmenting type and corresponding type are not the same kind: class,
314314
mixin, enum, or extension. You can't augment a class with a mixin, etc.
315315

316+
* The augmenting type and corresponding type do not have all the same
317+
modifiers (final, sealed, mixin, etc). This is not a technical requirement
318+
but it should make augmentations easier to understand when looking at them.
319+
316320
* The augmenting type declares an `extends` clause. Only the main declaration
317321
can specify those.
318322

319323
**TODO: We could consider allowing an `extends` clause if the main
320324
declaration doesn't have one.**
321325

322-
* The augmenting type is marked `abstract`. The main library determines
323-
whether the class is abstract or not.
324-
325326
* The type parameters of the type augmentation do not match the original
326327
type's type parameters. This means there must be the same number of type
327328
parameters with the same bounds.

0 commit comments

Comments
 (0)