Skip to content

Commit 945b6e4

Browse files
authored
Add an error and adjust the terminology slightly about augmented redirecting constructors (#4157)
Adjust the terminology slightly about augmented redirecting constructors
1 parent a530cd6 commit 945b6e4

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

working/augmentation-libraries/feature-specification.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,9 @@ It is a compile-time error if:
855855
replace a declared super constructor._ **(TODO: Why not? We allow
856856
"replacing implementation", and this is *something* like that.)**
857857

858-
* The resulting constructor is not valid (has a redirecting initializer and
859-
other initializers, multiple `super` initializers, etc).
858+
* The resulting constructor is not valid *(it has a redirection as well as
859+
some initializer list elements, or it has multiple `super` initializers,
860+
etc)*.
860861

861862
* A non-redirecting constructor augments a constructor which is not
862863
potentially non-redirecting.
@@ -923,20 +924,21 @@ present), and it may invoke the augmented body by calling
923924

924925
#### Redirecting generative constructors
925926

926-
A redirecting generative constructor marked `augment` adds its redirecting
927-
initializer to the augmented constructors initializer list.
927+
A redirecting generative constructor marked `augment` adds its redirection
928+
to the augmented constructor.
928929

929930
This converts it into a redirecting generative constructor, removing the
930931
potentially non-redirecting property of the constructor.
931932

932933
It is a compile-time error if:
933934

934-
* The augmented constructor has any initializers or a body.
935+
* The augmented constructor has an initializer list or a body, or it has a
936+
redirection.
935937

936938
#### Redirecting factory constructors
937939

938940
A redirecting factory constructor marked `augment` adds its factory redirection
939-
to the augmented constructor.
941+
*(e.g., `= C<int>.name`)* to the augmented constructor.
940942

941943
The result of applying the augmenting constructor is a redirecting factory
942944
constructor with the same target constructor designation as the augmenting
@@ -945,7 +947,7 @@ constructor.
945947

946948
It is a compile-time error if:
947949

948-
* The augmented constructor has a body.
950+
* The augmented factory constructor has a body, or it is redirecting.
949951

950952
#### Extension types
951953

@@ -1201,8 +1203,6 @@ declaration ::= 'external'? factoryConstructorSignature
12011203
| constructorSignature (redirection | initializers)?
12021204
```
12031205

1204-
**TODO: Define the grammar for the various `augmented` expressions.**
1205-
12061206
It is a compile-time error if:
12071207

12081208
* A declaration marked `augment` is also marked `external`. **(TODO: Probably

0 commit comments

Comments
 (0)