@@ -157,8 +157,8 @@ may themselves contain `import augment` directives. The entire tree of
157
157
augmentations is recursively applied to the main library. In most cases, the
158
158
order that augmentations are applied doesn't matter, but it is visible in a
159
159
couple of corners where the merge process involves "appending". For those cases,
160
- merge order is defined as an in- order traversal of the ` import augment `
161
- directives in the main library and its augmentations. So, in:
160
+ merge order is defined as a depth-first pre- order traversal of the `import
161
+ augment` directives in the main library and its augmentations. So, in:
162
162
163
163
```
164
164
// main.dart
@@ -202,6 +202,10 @@ original function, getter, setter, or variable initializer.
202
202
203
203
** TODO: I'm not sold on ` augment super ` . Is there a better syntax?**
204
204
205
+ The same declaration can be augmented multiple times by separate augmentation
206
+ libraries. When that happens, the merge order defined previously determines
207
+ which order the wrapping is applied.
208
+
205
209
### Augmenting types
206
210
207
211
A class, mixin, or extension declaration can be marked with an ` augment `
@@ -248,8 +252,8 @@ It is a compile-time error if:
248
252
** TODO: We could consider allowing an ` extends ` clause if the main
249
253
declaration doesn't have one.**
250
254
251
- * The augmenting type is marked ` abstract ` and the corresponding type is not
252
- or vice versa .
255
+ * The augmenting type is marked ` abstract ` . The main library determines
256
+ whether the class is abstract or not .
253
257
254
258
### Augmenting functions
255
259
@@ -292,11 +296,6 @@ It is a compile-time error if:
292
296
the augmentation dynamically detect whether there is an original body to
293
297
wrap?**
294
298
295
- * If multiple augmenting libraries augment the same original function.
296
-
297
- ** TODO: Should we allow this? The order is defined, so we could let them
298
- nest arbitrarily deeply.**
299
-
300
299
** TODO: Should we allow augmenting functions to add parameters? If so, how does
301
300
this interact with type checking calls to the function?**
302
301
@@ -380,10 +379,6 @@ It is a compile-time error if:
380
379
* An augmenting initializer uses ` augment super ` and the original declaration
381
380
is not a variable with an initializer.
382
381
383
- * Multiple augmenting libraries augment the same variable or getter/setter
384
- pair. Of course, one augmenting library may explicitly augment both a getter
385
- and setter with the same name.
386
-
387
382
* A final variable is augmented with a setter. (Instead, the augmentation
388
383
library can declare a * non-augmenting* setter that goes alongside the
389
384
implicit getter defined by the final variable.)
@@ -600,7 +595,7 @@ To apply an augmentation to the main library:
600
595
601
596
1 . For each public declaration in the augmentation:
602
597
603
- ** TODO: If we allow private imports, update this allow merging private
598
+ ** TODO: If we allow private imports, update this allow to merging private
604
599
declarations whose name matches a declaration in the main library.**
605
600
606
601
1 . Merge the declaration into the main library's top-level namespace using
0 commit comments