Skip to content

Commit 2b2d58b

Browse files
committed
[augmentations] No default values for parameters in augmentations.
1 parent 18c33ae commit 2b2d58b

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

working/augmentation-libraries/feature-specification.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Augmentation Libraries
22

3-
Author: [email protected], Version: 1.2 (see [Changelog](#Changelog) at end)
3+
Author: [email protected], Version: 1.3 (see [Changelog](#Changelog) at end)
44

55
Augmentation libraries allow splitting a Dart library into files. Unlike part
66
files, each augmentation has its [own imports][part imports] and top-level
@@ -309,6 +309,9 @@ It is a compile-time error if:
309309
augmenting function can see the declarations of any parameters that it
310310
uses in its body.*
311311

312+
* The function augmentation specifies any default values. *Default values are
313+
defined solely by the original function.*
314+
312315
* The original function is declared `external` and the augmenting function
313316
uses `augment super()`.
314317

@@ -419,17 +422,19 @@ original constructor's body.
419422

420423
It is a compile-time error if:
421424

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.
430432

431433
**TODO: Is this the right way to handle initializing formals?**
432434

435+
* The constructor augmentation specifies any default values. *Default values
436+
defined solely by the original constructor.*
437+
433438
* The original constructor is `const` and the augmenting constructor is not
434439
or vice versa.
435440

@@ -708,6 +713,10 @@ tools.
708713

709714
## Changelog
710715

716+
### 1.3
717+
718+
* Constructor and function augmentations can't define default values.
719+
711720
### 1.2
712721

713722
* Specify that augmenting constructor initializers are inserted before the

0 commit comments

Comments
 (0)