Skip to content

Commit fb8a843

Browse files
authored
Clarify preclusion (#3823)
1 parent 8194951 commit fb8a843

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

accepted/future-releases/extension-types/feature-specification.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ information about the process, including in their change logs.
1515
[1]: https://github.com/dart-lang/language/blob/master/working/1426-extension-types/feature-specification-views.md
1616
[2]: https://github.com/dart-lang/language/blob/master/working/extension_structs/overview.md
1717

18+
2024.05.21
19+
- Clarify that preclusion is caused by instance members and not by static
20+
members.
21+
1822
2024.01.17
1923
- Specify that a type is 'incompatible with await', and use that to specify
2024
a compile-time error at `await e;`.
@@ -528,15 +532,16 @@ extension type members.*
528532
We need to introduce a concept that is similar to existing concepts
529533
for regular classes, namely that an extension type _has_ a certain member.
530534

531-
First, we say that an extension type member declaration _DM_ _precludes_ an
532-
extension type member declaration _DM2_ if they have the same name, or the
533-
basename of _DM_ is the same as the basename of _DM2_, and one of _DM_ and
534-
_DM2_ is a setter declaration, and the other is a method declaration.
535+
First, we say that an extension type instance member declaration _DM_
536+
_precludes_ an extension type instance member declaration _DM2_ if they
537+
have the same name, or the basename of _DM_ is the same as the basename of
538+
_DM2_, and one of _DM_ and _DM2_ is a setter declaration, and the other is
539+
a method declaration.
535540

536-
Moreover, we say that an extension type member declaration _DM_ _precludes_
537-
a non-extension type member signature `m` if they have the same name, or
538-
the basename of _DM_ is the same as the basename of `m`, and _DM_ is a
539-
setter declaration and `m` is a method signature, or _DM_ is a method
541+
Moreover, we say that an extension type instance member declaration _DM_
542+
_precludes_ a non-extension type member signature `m` if they have the same
543+
name, or the basename of _DM_ is the same as the basename of `m`, and _DM_
544+
is a setter declaration and `m` is a method signature, or _DM_ is a method
540545
declaration and `m` is a setter signature.
541546

542547
*We use this concept with superinterfaces of DM. DM may have multiple
@@ -551,11 +556,11 @@ given name.*
551556
We say that an extension type declaration _DV_ _has_ an extension type
552557
member named `n` in the cases where:
553558

554-
- _DV_ declares a member named `n`.
559+
- _DV_ declares an instance member named `n`.
555560
- _DV_ has no such declaration, but _DV_ has a direct extension type
556-
superinterface `V` that has an extension type member named `n` due to a
557-
member declaration _DM2_, and _DV_ does not declare a member that
558-
precludes _DM2_.
561+
superinterface `V` that has an extension type instance member named `n`
562+
due to a member declaration _DM2_, and _DV_ does not declare an instance
563+
member that precludes _DM2_.
559564

560565
*Note that it is well-defined which member declaration causes an extension
561566
type to have a given extension type member because a compile-time error
@@ -577,10 +582,10 @@ a member named `n`, and one of the following criteria is satisfied:
577582

578583
- _DV_ has a direct extension type superinterface `V` that has a
579584
non-extension type member with signature `m` and name `n`, and _DV_ does
580-
not declare a member that precludes `m`.
585+
not declare an instance member that precludes `m`.
581586
- _DV_ has a direct non-extension type superinterface whose interface
582-
contains a member signature `m` named `n`, and _DV_ does not declare a
583-
member that precludes `m`.
587+
contains a member signature `m` named `n`, and _DV_ does not declare an
588+
instance member that precludes `m`.
584589

585590
The member signature of such a member is the combined member signature of
586591
all non-extension type members named `n` that _DV_ has, again using a

0 commit comments

Comments
 (0)