@@ -15,6 +15,11 @@ information about the process, including in their change logs.
15
15
[ 1 ] : https://github.com/dart-lang/language/blob/master/working/1426-extension-types/feature-specification-views.md
16
16
[ 2 ] : https://github.com/dart-lang/language/blob/master/working/extension_structs/overview.md
17
17
18
+ 2023.11.14
19
+ - Specify that a method declaration will shadow an otherwise "inherited"
20
+ setter with the same basename, and vice versa. This eliminates a
21
+ method/setter conflict that would otherwise be impossible to avoid.
22
+
18
23
2023.10.31
19
24
- Simplify the rules about the relationship between extension types and the
20
25
types ` Object ` and ` Object? ` .
@@ -516,14 +521,43 @@ type declaration, but this section is concerned with invocations of
516
521
extension type members.*
517
522
518
523
We need to introduce a concept that is similar to existing concepts
519
- for regular classes.
524
+ for regular classes, namely that an extension type _ has_ a certain member.
525
+
526
+ First, we say that an extension type member declaration _ DM_ _ precludes_ an
527
+ extension type member declaration _ DM2_ if they have the same name, or the
528
+ basename of _ DM_ is the same as the basename of _ DM2_ , and one of _ DM_ and
529
+ _ DM2_ is a setter declaration, and the other is a method declaration.
530
+
531
+ Moreover, we say that an extension type member declaration _ DM_ _ precludes_
532
+ a non-extension type member signature ` m ` if they have the same name, or
533
+ the basename of _ DM_ is the same as the basename of ` m ` , and _ DM_ is a
534
+ setter declaration and ` m ` is a method signature, or _ DM_ is a method
535
+ declaration and ` m ` is a setter signature.
536
+
537
+ * We use this concept with superinterfaces of DM. DM may have multiple
538
+ non-extension type superinterfaces, and they may differ with respect to the
539
+ precise member signature for a given member name, but they will not differ
540
+ with respect to the kind: ` m ` may be a method or a setter or a getter, but
541
+ it cannot be, e.g., a method in one superinterface and a getter in another
542
+ one. Hence, it is well-defined to talk about ` m ` being a method or a setter
543
+ signature even though there may be multiple member signatures with the
544
+ given name.*
520
545
521
546
We say that an extension type declaration _ DV_ _ has_ an extension type
522
- member named ` n ` in the case where _ DV_ declares a member named ` n ` , and in
523
- the case where _ DV_ has no such declaration, but _ DV_ has a direct
524
- extension type superinterface ` V ` that has an extension type member named
525
- ` n ` . In both cases, when this is unique, _ the extension type member
526
- declaration named ` n ` that DV has_ is said declaration.
547
+ member named ` n ` in the cases where:
548
+
549
+ - _ DV_ declares a member named ` n ` .
550
+ - _ DV_ has no such declaration, but _ DV_ has a direct extension type
551
+ superinterface ` V ` that has an extension type member named ` n ` due to a
552
+ member declaration _ DM2_ , and _ DV_ does not declare a member that
553
+ precludes _ DM2_ .
554
+
555
+ * Note that it is well-defined which member declaration causes an extension
556
+ type to have a given extension type member because a compile-time error
557
+ occurs whenever this is ambiguous: Either _ DV_ contains a declaration
558
+ named ` n ` , or at most one superinterface has an extension type member named
559
+ ` n ` , which is then (by induction) due to a uniquely determined
560
+ extension type member declaration.*
527
561
528
562
The type (function type for a method, return type for a getter) of this
529
563
declaration relative to this invocation is determined by repeatedly
@@ -534,10 +568,14 @@ type parameters of the extension type into the type of that declaration.
534
568
535
569
Similarly, we say that an extension type declaration _ DV_ _ has_ a
536
570
non-extension type member named ` n ` in the case where _ DV_ does not declare
537
- a member named ` n ` , but _ DV_ has a direct extension type superinterface ` V `
538
- that has a non-extension type member named ` n ` , or _ DV_ has a direct
539
- non-extension type superinterface ` T ` whose interface contains a member
540
- signature named ` n ` .
571
+ a member named ` n ` , and one of the following criteria is satisfied:
572
+
573
+ - _ DV_ has a direct extension type superinterface ` V ` that has a
574
+ non-extension type member with signature ` m ` and name ` n ` , and _ DV_ does
575
+ not declare a member that precludes ` m ` .
576
+ - _ DV_ has a direct non-extension type superinterface whose interface
577
+ contains a member signature ` m ` named ` n ` , and _ DV_ does not declare a
578
+ member that precludes ` m ` .
541
579
542
580
The member signature of such a member is the combined member signature of
543
581
all non-extension type members named ` n ` that _ DV_ has, again using a
0 commit comments