Skip to content

Commit 3cdbe58

Browse files
authored
[extension-types] Add error for duplicate implements type (#3400)
Add a compile-time error for duplicate `implements` type, corresponding to the existing rule about class, mixin, mixin class, and enum declarations.
1 parent 004e8cd commit 3cdbe58

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
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+
2023.10.16
19+
- Add error for `implements ... T ... T ...`, like the corresponding
20+
error with classes, mixins, etc.
21+
1822
2023.09.11
1923
- Add missing rule about getter/setter signature correspondence.
2024

@@ -769,7 +773,7 @@ declaration occurs in a non-covariant position in the representation type.
769773
A compile-time error occurs if the representation type of an extension type
770774
declaration is a bottom type.
771775

772-
*Note that it is still possible for the instantiated representation type
776+
*Note that it is still possible for the instantiated representation type
773777
of a given extension type to be a bottom type. For example, assuming
774778
`extension type E<X>(X x) {}`, `E<Never>` would be an extension type whose
775779
instantiated representation type is `Never`. The reason for this error is that
@@ -1127,6 +1131,13 @@ A compile-time error occurs if any direct or indirect superinterface of
11271131
_DV_ denotes the declaration _DV_. *As usual, subtype cycles are not
11281132
allowed.*
11291133

1134+
It is a compile-time error if two elements in the type list of the
1135+
`implements` clause of an extension type declaration specifies the
1136+
same type.
1137+
1138+
*This rule against duplicates corresponds to the existing rule for
1139+
class, mixin, and enum declarations.*
1140+
11301141
Assume that _DV_ has two direct or indirect superinterfaces of the form
11311142
<code>W\<T<sub>1</sub>, .. T<sub>k</sub>&gt;</code>
11321143
respectively

0 commit comments

Comments
 (0)