Skip to content

Clarify that the usual getter/setter type rule exists for extension types as well #3338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions accepted/future-releases/extension-types/feature-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down