|
1 | 1 | # Augmentation Libraries
|
2 | 2 |
|
3 |
| -Author: [email protected], Version: 1. 2 (see [Changelog ](#Changelog) at end) |
| 3 | +Author: [email protected], Version: 1. 3 (see [Changelog ](#Changelog) at end) |
4 | 4 |
|
5 | 5 | Augmentation libraries allow splitting a Dart library into files. Unlike part
|
6 | 6 | files, each augmentation has its [own imports][part imports] and top-level
|
@@ -309,6 +309,9 @@ It is a compile-time error if:
|
309 | 309 | augmenting function can see the declarations of any parameters that it
|
310 | 310 | uses in its body.*
|
311 | 311 |
|
| 312 | +* The function augmentation specifies any default values. *Default values are |
| 313 | + defined solely by the original function.* |
| 314 | + |
312 | 315 | * The original function is declared `external` and the augmenting function
|
313 | 316 | uses `augment super()`.
|
314 | 317 |
|
@@ -419,17 +422,19 @@ original constructor's body.
|
419 | 422 |
|
420 | 423 | It is a compile-time error if:
|
421 | 424 |
|
422 |
| -* The signature of the constructor augmentation does not exactly match the |
423 |
| - original constructor. This means the return types must be the same; there |
424 |
| - must be the same number of positional, optional, and named parameters; the |
425 |
| - types of corresponding positional and optional parameters must be the same; |
426 |
| - the names and types of named parameters must be the same; any type |
427 |
| - parameters and bounds must be the same; and any `required` or `covariant` |
428 |
| - modifiers must match. Any initializing formals must be the same in both |
429 |
| - constructors. |
| 425 | +* The signature of the constructor augmentation does not match the original |
| 426 | + constructor. This means the return types must be the same; there must be the |
| 427 | + same number of positional, optional, and named parameters; the types of |
| 428 | + corresponding positional and optional parameters must be the same; the names |
| 429 | + and types of named parameters must be the same; any type parameters and |
| 430 | + bounds must be the same; and any `required` or `covariant` modifiers must |
| 431 | + match. Any initializing formals must be the same in both constructors. |
430 | 432 |
|
431 | 433 | **TODO: Is this the right way to handle initializing formals?**
|
432 | 434 |
|
| 435 | +* The constructor augmentation specifies any default values. *Default values |
| 436 | + defined solely by the original constructor.* |
| 437 | + |
433 | 438 | * The original constructor is `const` and the augmenting constructor is not
|
434 | 439 | or vice versa.
|
435 | 440 |
|
@@ -708,6 +713,10 @@ tools.
|
708 | 713 |
|
709 | 714 | ## Changelog
|
710 | 715 |
|
| 716 | +### 1.3 |
| 717 | + |
| 718 | +* Constructor and function augmentations can't define default values. |
| 719 | + |
711 | 720 | ### 1.2
|
712 | 721 |
|
713 | 722 | * Specify that augmenting constructor initializers are inserted before the
|
|
0 commit comments