Skip to content

Commit 8ffcaff

Browse files
authored
add a restriction that augmented types must duplicate all keywords (#2959)
1 parent d0d3ca2 commit 8ffcaff

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

working/augmentation-libraries/feature-specification.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Augmentation Libraries
22

3-
Author: [email protected], Version: 1.6 (see [Changelog](#Changelog) at end)
3+
4+
Version: 1.7 (see [Changelog](#Changelog) at end)
45

56
Augmentation libraries allow splitting a Dart library into files. Unlike part
67
files, each augmentation has its [own imports][part imports] and top-level
@@ -292,6 +293,11 @@ This means that instead of creating a new type declaration, the augmentation
292293
modifies a corresponding declaration in the main library or one of its other
293294
augmentations.
294295

296+
All the keywords (other than `augment`) must be identical between the original
297+
declaration and the augmentation. This is to ensure that looking at either one
298+
will give a complete depiction of the capabilities of the type, and an
299+
augmentation cannot introduce hidden restrictions.
300+
295301
A class or enum augmentation may specify `implements` and `with` clauses. When
296302
those appear, the specified superinterfaces and mixins are appended to the main
297303
class's superinterface and mixin lists, respectively.
@@ -798,6 +804,11 @@ language and our tools.
798804

799805
## Changelog
800806

807+
### 1.7
808+
809+
* Specify that augmentations must contain all the same keywords as the
810+
original declaration (and no more).
811+
801812
### 1.6
802813

803814
* Allow class augmentations to use different names for type parameters. This

0 commit comments

Comments
 (0)