From 8b252a5c2dbd24053077e0ed4431b8a8c1f85581 Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Mon, 11 Sep 2023 16:04:58 +0200 Subject: [PATCH] Add missing getter/setter type rule --- .../extension-types/feature-specification.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/accepted/future-releases/extension-types/feature-specification.md b/accepted/future-releases/extension-types/feature-specification.md index 94cd598c2a..e47c7bfebb 100644 --- a/accepted/future-releases/extension-types/feature-specification.md +++ b/accepted/future-releases/extension-types/feature-specification.md @@ -15,6 +15,9 @@ information about the process, including in their change logs. [1]: https://github.com/dart-lang/language/blob/master/working/1426-extension-types/feature-specification-views.md [2]: https://github.com/dart-lang/language/blob/master/working/extension_structs/overview.md +2023.09.11 + - Add missing rule about getter/setter signature correspondence. + 2023.08.17 - Add covariance subtype rule for extension types. Add rule that it is an error for an extension type member to be abstract. Mention that it is @@ -704,6 +707,13 @@ declaration is abstract. resolved, and abstract members only make sense in the case where the given member is resolved at run time.* +It is a compile-time error if an extension type has a getter named `g` with +return type `R` and a setter named `g=` with parameter type `S`, +and `R` is not a subtype of `S`. + +*This rule is applicable to instance getters and setters as well as static +getters and setters.* + *It is not an error for an extension type member to have the modifier `external`. As usual, an implementation can report a compile-time error for external declarations, e.g., if they are not bound to an implementation,