Skip to content

Commit

Permalink
[extension-types] Add error for duplicate implements type (#3400)
Browse files Browse the repository at this point in the history
Add a compile-time error for duplicate `implements` type, corresponding to the existing rule about class, mixin, mixin class, and enum declarations.
  • Loading branch information
eernstg authored Oct 16, 2023
1 parent 004e8cd commit 3cdbe58
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ 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.10.16
- Add error for `implements ... T ... T ...`, like the corresponding
error with classes, mixins, etc.

2023.09.11
- Add missing rule about getter/setter signature correspondence.

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

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

It is a compile-time error if two elements in the type list of the
`implements` clause of an extension type declaration specifies the
same type.

*This rule against duplicates corresponds to the existing rule for
class, mixin, and enum declarations.*

Assume that _DV_ has two direct or indirect superinterfaces of the form
<code>W\<T<sub>1</sub>, .. T<sub>k</sub>&gt;</code>
respectively
Expand Down

0 comments on commit 3cdbe58

Please sign in to comment.