From 870b572040c84e2541a15991b3f7db88520a43ed Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Thu, 7 Nov 2024 12:51:47 +0100 Subject: [PATCH 1/7] Adjust the terminology slightly about augmented redirecting constructors --- .../augmentation-libraries/feature-specification.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/working/augmentation-libraries/feature-specification.md b/working/augmentation-libraries/feature-specification.md index 5352fadb2d..06683e81c4 100644 --- a/working/augmentation-libraries/feature-specification.md +++ b/working/augmentation-libraries/feature-specification.md @@ -855,8 +855,8 @@ It is a compile-time error if: replace a declared super constructor._ **(TODO: Why not? We allow "replacing implementation", and this is *something* like that.)** -* The resulting constructor is not valid (has a redirecting initializer and - other initializers, multiple `super` initializers, etc). +* The resulting constructor is not valid (has a redirection as well as + some initializer list elements, multiple `super` initializers, etc). * A non-redirecting constructor augments a constructor which is not potentially non-redirecting. @@ -923,8 +923,8 @@ present), and it may invoke the augmented body by calling #### Redirecting generative constructors -A redirecting generative constructor marked `augment` adds its redirecting -initializer to the augmented constructors initializer list. +A redirecting generative constructor marked `augment` adds its redirection +to the augmented constructor. This converts it into a redirecting generative constructor, removing the potentially non-redirecting property of the constructor. @@ -936,6 +936,7 @@ It is a compile-time error if: #### Redirecting factory constructors A redirecting factory constructor marked `augment` adds its factory redirection +*(that is `=` and a constructor designation, e.g., `= C.name`)* to the augmented constructor. The result of applying the augmenting constructor is a redirecting factory @@ -945,7 +946,8 @@ constructor. It is a compile-time error if: -* The augmented constructor has a body. +* The augmented constructor is not potentially redirecting *(that is, if it + has a body or one or more initializer list elements)*. #### Extension types From 32a9c6646bbf0446546c7f705263b55cb65aac82 Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Thu, 7 Nov 2024 13:34:49 +0100 Subject: [PATCH 2/7] Typos --- working/augmentation-libraries/feature-specification.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/working/augmentation-libraries/feature-specification.md b/working/augmentation-libraries/feature-specification.md index 06683e81c4..f1fc30267d 100644 --- a/working/augmentation-libraries/feature-specification.md +++ b/working/augmentation-libraries/feature-specification.md @@ -946,8 +946,7 @@ constructor. It is a compile-time error if: -* The augmented constructor is not potentially redirecting *(that is, if it - has a body or one or more initializer list elements)*. +* The augmented constructor has a body. #### Extension types @@ -1203,8 +1202,6 @@ declaration ::= 'external'? factoryConstructorSignature | constructorSignature (redirection | initializers)? ``` -**TODO: Define the grammar for the various `augmented` expressions.** - It is a compile-time error if: * A declaration marked `augment` is also marked `external`. **(TODO: Probably From 1965cbdd5a3763aaee8832e9f3a46257ce7c7cb2 Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Thu, 7 Nov 2024 13:37:32 +0100 Subject: [PATCH 3/7] WIP --- working/augmentation-libraries/feature-specification.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/working/augmentation-libraries/feature-specification.md b/working/augmentation-libraries/feature-specification.md index f1fc30267d..c02817b680 100644 --- a/working/augmentation-libraries/feature-specification.md +++ b/working/augmentation-libraries/feature-specification.md @@ -936,8 +936,7 @@ It is a compile-time error if: #### Redirecting factory constructors A redirecting factory constructor marked `augment` adds its factory redirection -*(that is `=` and a constructor designation, e.g., `= C.name`)* -to the augmented constructor. +*(e.g., `= C.name`)* to the augmented constructor. The result of applying the augmenting constructor is a redirecting factory constructor with the same target constructor designation as the augmenting @@ -946,7 +945,7 @@ constructor. It is a compile-time error if: -* The augmented constructor has a body. +* The augmented factory constructor has a body. #### Extension types From 2c2d5c1345e7b4d09858f9a0d086090393802f6e Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Thu, 7 Nov 2024 13:39:54 +0100 Subject: [PATCH 4/7] WIP --- working/augmentation-libraries/feature-specification.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/working/augmentation-libraries/feature-specification.md b/working/augmentation-libraries/feature-specification.md index c02817b680..feeb12b3fd 100644 --- a/working/augmentation-libraries/feature-specification.md +++ b/working/augmentation-libraries/feature-specification.md @@ -855,8 +855,9 @@ It is a compile-time error if: replace a declared super constructor._ **(TODO: Why not? We allow "replacing implementation", and this is *something* like that.)** -* The resulting constructor is not valid (has a redirection as well as - some initializer list elements, multiple `super` initializers, etc). +* The resulting constructor is not valid *(it has a redirection as well as + some initializer list elements, or it has multiple `super` initializers, + etc)*. * A non-redirecting constructor augments a constructor which is not potentially non-redirecting. From b8f3d87fcfc3c33e26168fe7943916bf57e55b53 Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Thu, 7 Nov 2024 14:02:48 +0100 Subject: [PATCH 5/7] WIP --- working/augmentation-libraries/feature-specification.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/working/augmentation-libraries/feature-specification.md b/working/augmentation-libraries/feature-specification.md index feeb12b3fd..562af1bf0b 100644 --- a/working/augmentation-libraries/feature-specification.md +++ b/working/augmentation-libraries/feature-specification.md @@ -932,7 +932,8 @@ potentially non-redirecting property of the constructor. It is a compile-time error if: -* The augmented constructor has any initializers or a body. +* The augmented constructor has an initializer list or a body, or it has a + redirection. #### Redirecting factory constructors From 459da4d7f23bde334b3ede15edb77aa1f2ec8d26 Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Thu, 7 Nov 2024 15:11:32 +0100 Subject: [PATCH 6/7] WIP --- working/augmentation-libraries/feature-specification.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/working/augmentation-libraries/feature-specification.md b/working/augmentation-libraries/feature-specification.md index 562af1bf0b..ba8f56b5ee 100644 --- a/working/augmentation-libraries/feature-specification.md +++ b/working/augmentation-libraries/feature-specification.md @@ -947,7 +947,7 @@ constructor. It is a compile-time error if: -* The augmented factory constructor has a body. +* The augmented factory constructor has a body, or it is already redirecting. #### Extension types From d24af79f0034c5930d8991a6557316fb114d2d08 Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Thu, 7 Nov 2024 15:13:35 +0100 Subject: [PATCH 7/7] WIP --- working/augmentation-libraries/feature-specification.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/working/augmentation-libraries/feature-specification.md b/working/augmentation-libraries/feature-specification.md index ba8f56b5ee..5c1198a1aa 100644 --- a/working/augmentation-libraries/feature-specification.md +++ b/working/augmentation-libraries/feature-specification.md @@ -947,7 +947,7 @@ constructor. It is a compile-time error if: -* The augmented factory constructor has a body, or it is already redirecting. +* The augmented factory constructor has a body, or it is redirecting. #### Extension types