#1258. Update Enhanced Enums test. Now user-written 'values' and 'index' are not allowed
diff --git a/LanguageFeatures/Enhanced-Enum/grammar_A10_t01.dart b/LanguageFeatures/Enhanced-Enum/grammar_A10_t01.dart
new file mode 100644
index 0000000..5eaab97
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/grammar_A10_t01.dart
@@ -0,0 +1,69 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It's a compile-time error if the enum declaration contains a
+/// static or instance member declaration with the name `values`, or if the
+/// superclass or any superinterface of the enum declaration has an interface
+/// member named `values`. A `values` static constant member will be provided
+/// for the class, this restriction ensures that there is no conflict with that
+/// declaration.
+///
+/// @description Check that it's a compile-time error if the enum declaration
+/// contains a static member declaration with the name `values`
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+enum E1<T> {
+ e1,
+ e2,
+ e3;
+
+ static int values = 42;
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+enum E2<T> {
+ e1,
+ e2,
+ e3;
+
+ static final int values = 42;
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+enum E3<T> {
+ e1<int>(1),
+ e2<String>("2"),
+ e3<bool>(true);
+
+ const E3(Object val);
+ static List<E3> values = [];
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+enum E4<T> {
+ e1<int>(1),
+ e2<String>("2"),
+ e3<bool>(true);
+
+ const E4(Object val);
+ static final List<E4> values = [];
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ E1.e1;
+ E2.e1;
+ E3.e1;
+ E4.e1;
+}
diff --git a/LanguageFeatures/Enhanced-Enum/grammar_A10_t02.dart b/LanguageFeatures/Enhanced-Enum/grammar_A10_t02.dart
new file mode 100644
index 0000000..e3e21e7
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/grammar_A10_t02.dart
@@ -0,0 +1,44 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It's a compile-time error if the enum declaration contains a
+/// static or instance member declaration with the name `values`, or if the
+/// superclass or any superinterface of the enum declaration has an interface
+/// member named `values`. A `values` static constant member will be provided
+/// for the class, this restriction ensures that there is no conflict with that
+/// declaration.
+///
+/// @description Check that it's a compile-time error if the enum declaration
+/// contains a static member declaration with the name `values`
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+enum E1<T> {
+ e1,
+ e2,
+ e3;
+
+ static int values() => 42;
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+enum E2<T> {
+ e1<int>(1),
+ e2<String>("2"),
+ e3<bool>(true);
+
+ const E2(Object val);
+ static List<E2> values() => [];
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ E1.e1;
+ E2.e1;
+}
diff --git a/LanguageFeatures/Enhanced-Enum/grammar_A10_t03.dart b/LanguageFeatures/Enhanced-Enum/grammar_A10_t03.dart
new file mode 100644
index 0000000..3da1869
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/grammar_A10_t03.dart
@@ -0,0 +1,44 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It's a compile-time error if the enum declaration contains a
+/// static or instance member declaration with the name `values`, or if the
+/// superclass or any superinterface of the enum declaration has an interface
+/// member named `values`. A `values` static constant member will be provided
+/// for the class, this restriction ensures that there is no conflict with that
+/// declaration.
+///
+/// @description Check that it's a compile-time error if the enum declaration
+/// contains a static member declaration with the name `values`
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+enum E1<T> {
+ e1,
+ e2,
+ e3;
+
+ static int get values => 42;
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+enum E2<T> {
+ e1<int>(1),
+ e2<String>("2"),
+ e3<bool>(true);
+
+ const E2(Object val);
+ static List<E2> get values => [];
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ E1.e1;
+ E2.e1;
+}
diff --git a/LanguageFeatures/Enhanced-Enum/grammar_A10_t04.dart b/LanguageFeatures/Enhanced-Enum/grammar_A10_t04.dart
new file mode 100644
index 0000000..64b722c
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/grammar_A10_t04.dart
@@ -0,0 +1,44 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It's a compile-time error if the enum declaration contains a
+/// static or instance member declaration with the name `values`, or if the
+/// superclass or any superinterface of the enum declaration has an interface
+/// member named `values`. A `values` static constant member will be provided
+/// for the class, this restriction ensures that there is no conflict with that
+/// declaration.
+///
+/// @description Check that it's a compile-time error if the enum declaration
+/// contains a static member declaration with the name `values`
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+enum E1<T> {
+ e1,
+ e2,
+ e3;
+
+ static void set values(int value) {}
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+enum E2<T> {
+ e1<int>(1),
+ e2<String>("2"),
+ e3<bool>(true);
+
+ const E2(Object val);
+ static void set values(List<E2> value) {}
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ E1.e1;
+ E2.e1;
+}
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A01_t01.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A01_t01.dart
index e998419..8e46098 100644
--- a/LanguageFeatures/Enhanced-Enum/implementing_enum_A01_t01.dart
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A01_t01.dart
@@ -9,21 +9,42 @@
/// applied to enum declarations, and therefore to assume Enum to be a
/// superclass, we loosen that restriction to:
///
-/// It’s a compile-time error if a non-abstract class implements Enum unless it
-/// is the implicit class of an enum declaration.
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
///
-/// It is a compile-time error if a class implements, extends or mixes-in a
-/// class declared by an enum declaration.
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
///
-/// That allows abstract classes (interfaces) which implements Enum in order to
-/// have the int index; getter member available, and it allows mixin
-/// declarations to use Enum as an on type because mixin declarations cannot be
-/// instantiated directly.
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
///
-/// This restriction still ensure enum values are the only object instances
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
/// which implements Enum, while making it valid to declare abstract class
/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
-/// mixins intended to be used in declaring enum classes.
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
///
/// @description Check that it’s a compile-time error if a non-abstract class
/// implements Enum and it is not the implicit class of an enum declaration.
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A01_t02.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A01_t02.dart
index 9ad3053..3420b15 100644
--- a/LanguageFeatures/Enhanced-Enum/implementing_enum_A01_t02.dart
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A01_t02.dart
@@ -9,21 +9,42 @@
/// applied to enum declarations, and therefore to assume Enum to be a
/// superclass, we loosen that restriction to:
///
-/// It’s a compile-time error if a non-abstract class implements Enum unless it
-/// is the implicit class of an enum declaration.
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
///
-/// It is a compile-time error if a class implements, extends or mixes-in a
-/// class declared by an enum declaration.
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
///
-/// That allows abstract classes (interfaces) which implements Enum in order to
-/// have the int index; getter member available, and it allows mixin
-/// declarations to use Enum as an on type because mixin declarations cannot be
-/// instantiated directly.
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
///
-/// This restriction still ensure enum values are the only object instances
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
/// which implements Enum, while making it valid to declare abstract class
/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
-/// mixins intended to be used in declaring enum classes.
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
///
/// @description Check that abstract classes may implement enum
/// @author sgrekhov@unipro.ru
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A01_t03.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A01_t03.dart
index 500dd6b..d29c4dc 100644
--- a/LanguageFeatures/Enhanced-Enum/implementing_enum_A01_t03.dart
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A01_t03.dart
@@ -9,21 +9,42 @@
/// applied to enum declarations, and therefore to assume Enum to be a
/// superclass, we loosen that restriction to:
///
-/// It’s a compile-time error if a non-abstract class implements Enum unless it
-/// is the implicit class of an enum declaration.
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
///
-/// It is a compile-time error if a class implements, extends or mixes-in a
-/// class declared by an enum declaration.
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
///
-/// That allows abstract classes (interfaces) which implements Enum in order to
-/// have the int index; getter member available, and it allows mixin
-/// declarations to use Enum as an on type because mixin declarations cannot be
-/// instantiated directly.
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
///
-/// This restriction still ensure enum values are the only object instances
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
/// which implements Enum, while making it valid to declare abstract class
/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
-/// mixins intended to be used in declaring enum classes.
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
///
/// @description Check that implicit class of enum declaration implements Enum
/// @author sgrekhov@unipro.ru
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t01.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t01.dart
index b31fa02..3339f5d 100644
--- a/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t01.dart
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t01.dart
@@ -9,21 +9,42 @@
/// applied to enum declarations, and therefore to assume Enum to be a
/// superclass, we loosen that restriction to:
///
-/// It’s a compile-time error if a non-abstract class implements Enum unless it
-/// is the implicit class of an enum declaration.
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
///
-/// It is a compile-time error if a class implements, extends or mixes-in a
-/// class declared by an enum declaration.
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
///
-/// That allows abstract classes (interfaces) which implements Enum in order to
-/// have the int index; getter member available, and it allows mixin
-/// declarations to use Enum as an on type because mixin declarations cannot be
-/// instantiated directly.
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
///
-/// This restriction still ensure enum values are the only object instances
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
/// which implements Enum, while making it valid to declare abstract class
/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
-/// mixins intended to be used in declaring enum classes.
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
///
/// @description Check that it is a compile-time error if a class extends
/// a class declared by an enum declaration.
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t02.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t02.dart
index e64ca4d..21b6ab4 100644
--- a/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t02.dart
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t02.dart
@@ -9,21 +9,42 @@
/// applied to enum declarations, and therefore to assume Enum to be a
/// superclass, we loosen that restriction to:
///
-/// It’s a compile-time error if a non-abstract class implements Enum unless it
-/// is the implicit class of an enum declaration.
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
///
-/// It is a compile-time error if a class implements, extends or mixes-in a
-/// class declared by an enum declaration.
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
///
-/// That allows abstract classes (interfaces) which implements Enum in order to
-/// have the int index; getter member available, and it allows mixin
-/// declarations to use Enum as an on type because mixin declarations cannot be
-/// instantiated directly.
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
///
-/// This restriction still ensure enum values are the only object instances
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
/// which implements Enum, while making it valid to declare abstract class
/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
-/// mixins intended to be used in declaring enum classes.
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
///
/// @description Check that it is a compile-time error if a class extends
/// a class declared by an enum declaration.
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t03.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t03.dart
index a1d28a5..3cb2a68 100644
--- a/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t03.dart
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t03.dart
@@ -9,21 +9,42 @@
/// applied to enum declarations, and therefore to assume Enum to be a
/// superclass, we loosen that restriction to:
///
-/// It’s a compile-time error if a non-abstract class implements Enum unless it
-/// is the implicit class of an enum declaration.
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
///
-/// It is a compile-time error if a class implements, extends or mixes-in a
-/// class declared by an enum declaration.
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
///
-/// That allows abstract classes (interfaces) which implements Enum in order to
-/// have the int index; getter member available, and it allows mixin
-/// declarations to use Enum as an on type because mixin declarations cannot be
-/// instantiated directly.
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
///
-/// This restriction still ensure enum values are the only object instances
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
/// which implements Enum, while making it valid to declare abstract class
/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
-/// mixins intended to be used in declaring enum classes.
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
///
/// @description Check that it is a compile-time error if a class implements
/// a class declared by an enum declaration.
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t04.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t04.dart
index 3b19667..c509267 100644
--- a/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t04.dart
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t04.dart
@@ -9,21 +9,42 @@
/// applied to enum declarations, and therefore to assume Enum to be a
/// superclass, we loosen that restriction to:
///
-/// It’s a compile-time error if a non-abstract class implements Enum unless it
-/// is the implicit class of an enum declaration.
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
///
-/// It is a compile-time error if a class implements, extends or mixes-in a
-/// class declared by an enum declaration.
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
///
-/// That allows abstract classes (interfaces) which implements Enum in order to
-/// have the int index; getter member available, and it allows mixin
-/// declarations to use Enum as an on type because mixin declarations cannot be
-/// instantiated directly.
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
///
-/// This restriction still ensure enum values are the only object instances
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
/// which implements Enum, while making it valid to declare abstract class
/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
-/// mixins intended to be used in declaring enum classes.
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
///
/// @description Check that it is a compile-time error if a class implements
/// a class declared by an enum declaration.
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t05.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t05.dart
index 380f604..8cc67e6 100644
--- a/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t05.dart
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t05.dart
@@ -9,21 +9,42 @@
/// applied to enum declarations, and therefore to assume Enum to be a
/// superclass, we loosen that restriction to:
///
-/// It’s a compile-time error if a non-abstract class implements Enum unless it
-/// is the implicit class of an enum declaration.
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
///
-/// It is a compile-time error if a class implements, extends or mixes-in a
-/// class declared by an enum declaration.
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
///
-/// That allows abstract classes (interfaces) which implements Enum in order to
-/// have the int index; getter member available, and it allows mixin
-/// declarations to use Enum as an on type because mixin declarations cannot be
-/// instantiated directly.
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
///
-/// This restriction still ensure enum values are the only object instances
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
/// which implements Enum, while making it valid to declare abstract class
/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
-/// mixins intended to be used in declaring enum classes.
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
///
/// @description Check that it is a compile-time error if a class mixes-in
/// a class declared by an enum declaration.
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t06.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t06.dart
index 68d4fca..64c4a8c 100644
--- a/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t06.dart
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A02_t06.dart
@@ -9,21 +9,42 @@
/// applied to enum declarations, and therefore to assume Enum to be a
/// superclass, we loosen that restriction to:
///
-/// It’s a compile-time error if a non-abstract class implements Enum unless it
-/// is the implicit class of an enum declaration.
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
///
-/// It is a compile-time error if a class implements, extends or mixes-in a
-/// class declared by an enum declaration.
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
///
-/// That allows abstract classes (interfaces) which implements Enum in order to
-/// have the int index; getter member available, and it allows mixin
-/// declarations to use Enum as an on type because mixin declarations cannot be
-/// instantiated directly.
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
///
-/// This restriction still ensure enum values are the only object instances
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
/// which implements Enum, while making it valid to declare abstract class
/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
-/// mixins intended to be used in declaring enum classes.
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
///
/// @description Check that it is a compile-time error if a class mixes-in
/// a class declared by an enum declaration.
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t01.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t01.dart
new file mode 100644
index 0000000..38ca427
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t01.dart
@@ -0,0 +1,80 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It’s currently a compile-time error for a class to implement,
+/// extend or mix-in the Enum class.
+///
+/// Because we want to allow interfaces and mixins that are intended to be
+/// applied to enum declarations, and therefore to assume Enum to be a
+/// superclass, we loosen that restriction to:
+///
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
+///
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
+///
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
+///
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
+/// which implements Enum, while making it valid to declare abstract class
+/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
+///
+/// @description Check that it's a compile-time error if a class has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+enum E1 {
+ e1,
+ e2;
+
+ final int values = 42;
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+enum E2 {
+ e1(42),
+ e2(0);
+
+ const E2(int i);
+ final List<E2> values = [];
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ E1.e1;
+ E2.e1;
+}
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t02.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t02.dart
new file mode 100644
index 0000000..5723ab9
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t02.dart
@@ -0,0 +1,80 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It’s currently a compile-time error for a class to implement,
+/// extend or mix-in the Enum class.
+///
+/// Because we want to allow interfaces and mixins that are intended to be
+/// applied to enum declarations, and therefore to assume Enum to be a
+/// superclass, we loosen that restriction to:
+///
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
+///
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
+///
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
+///
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
+/// which implements Enum, while making it valid to declare abstract class
+/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
+///
+/// @description Check that it's a compile-time error if a class has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+enum E1 {
+ e1,
+ e2;
+
+ int values() => 42;
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+enum E2 {
+ e1(42),
+ e2(0);
+
+ const E2(int i);
+ List<E2> values() => [];
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ E1.e1;
+ E2.e1;
+}
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t03.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t03.dart
new file mode 100644
index 0000000..316a6bf
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t03.dart
@@ -0,0 +1,80 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It’s currently a compile-time error for a class to implement,
+/// extend or mix-in the Enum class.
+///
+/// Because we want to allow interfaces and mixins that are intended to be
+/// applied to enum declarations, and therefore to assume Enum to be a
+/// superclass, we loosen that restriction to:
+///
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
+///
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
+///
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
+///
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
+/// which implements Enum, while making it valid to declare abstract class
+/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
+///
+/// @description Check that it's a compile-time error if a class has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+enum E1 {
+ e1,
+ e2;
+
+ int get values => 42;
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+enum E2 {
+ e1(42),
+ e2(0);
+
+ const E2(int i);
+ List<E2> get values => [];
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ E1.e1;
+ E2.e1;
+}
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t04.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t04.dart
new file mode 100644
index 0000000..dff0b65
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t04.dart
@@ -0,0 +1,80 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It’s currently a compile-time error for a class to implement,
+/// extend or mix-in the Enum class.
+///
+/// Because we want to allow interfaces and mixins that are intended to be
+/// applied to enum declarations, and therefore to assume Enum to be a
+/// superclass, we loosen that restriction to:
+///
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
+///
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
+///
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
+///
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
+/// which implements Enum, while making it valid to declare abstract class
+/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
+///
+/// @description Check that it's a compile-time error if a class has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+enum E1 {
+ e1,
+ e2;
+
+ void set values(int val) {}
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+enum E2 {
+ e1(42),
+ e2(0);
+
+ const E2(int i);
+ void set values(List<E2> val) {}
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ E1.e1;
+ E2.e1;
+}
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t05.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t05.dart
new file mode 100644
index 0000000..1cc32bb
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t05.dart
@@ -0,0 +1,73 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It’s currently a compile-time error for a class to implement,
+/// extend or mix-in the Enum class.
+///
+/// Because we want to allow interfaces and mixins that are intended to be
+/// applied to enum declarations, and therefore to assume Enum to be a
+/// superclass, we loosen that restriction to:
+///
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
+///
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
+///
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
+///
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
+/// which implements Enum, while making it valid to declare abstract class
+/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
+///
+/// @description Check that it's a compile-time error if a mixin has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name `values`
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+mixin M1 on Enum {
+ final int values = 42;
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+mixin M2 on Enum {
+ final List values = [];
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ print(M1);
+ print(M2);
+}
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t06.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t06.dart
new file mode 100644
index 0000000..fa0758d
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t06.dart
@@ -0,0 +1,73 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It’s currently a compile-time error for a class to implement,
+/// extend or mix-in the Enum class.
+///
+/// Because we want to allow interfaces and mixins that are intended to be
+/// applied to enum declarations, and therefore to assume Enum to be a
+/// superclass, we loosen that restriction to:
+///
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
+///
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
+///
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
+///
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
+/// which implements Enum, while making it valid to declare abstract class
+/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
+///
+/// @description Check that it's a compile-time error if a mixin has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name `values`
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+mixin M1 on Enum {
+ int values() => 42;
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+mixin M2 on Enum {
+ List values() => [];
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ print(M1);
+ print(M2);
+}
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t07.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t07.dart
new file mode 100644
index 0000000..04d0785
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t07.dart
@@ -0,0 +1,73 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It’s currently a compile-time error for a class to implement,
+/// extend or mix-in the Enum class.
+///
+/// Because we want to allow interfaces and mixins that are intended to be
+/// applied to enum declarations, and therefore to assume Enum to be a
+/// superclass, we loosen that restriction to:
+///
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
+///
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
+///
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
+///
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
+/// which implements Enum, while making it valid to declare abstract class
+/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
+///
+/// @description Check that it's a compile-time error if a mixin has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name `values`
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+mixin M1 on Enum {
+ int get values => 42;
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+mixin M2 on Enum {
+ List get values => [];
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ print(M1);
+ print(M2);
+}
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t08.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t08.dart
new file mode 100644
index 0000000..5f4858a
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t08.dart
@@ -0,0 +1,73 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It’s currently a compile-time error for a class to implement,
+/// extend or mix-in the Enum class.
+///
+/// Because we want to allow interfaces and mixins that are intended to be
+/// applied to enum declarations, and therefore to assume Enum to be a
+/// superclass, we loosen that restriction to:
+///
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
+///
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
+///
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
+///
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
+/// which implements Enum, while making it valid to declare abstract class
+/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
+///
+/// @description Check that it's a compile-time error if a mixin has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name `values`
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+mixin M1 on Enum {
+ void set values(int val) {}
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+mixin M2 on Enum {
+ void set values(List val) {}
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ print(M1);
+ print(M2);
+}
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t09.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t09.dart
new file mode 100644
index 0000000..86f4951
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t09.dart
@@ -0,0 +1,99 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It’s currently a compile-time error for a class to implement,
+/// extend or mix-in the Enum class.
+///
+/// Because we want to allow interfaces and mixins that are intended to be
+/// applied to enum declarations, and therefore to assume Enum to be a
+/// superclass, we loosen that restriction to:
+///
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
+///
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
+///
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
+///
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
+/// which implements Enum, while making it valid to declare abstract class
+/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
+///
+/// @description Check that it's a compile-time error if a class has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+abstract class I1 {
+ final int values = 42;
+}
+
+class I2 {
+ final List values = [];
+}
+
+enum E1 implements I1 {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ e1,
+ e2;
+}
+
+enum E2 implements I2 {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ e1,
+ e2;
+}
+
+enum E3 implements I1 {
+ e1(42),
+ e2(0);
+
+ const E3(int i);
+}
+
+enum E4 implements I2 {
+ e1(42),
+ e2(0);
+
+ const E4(int i);
+}
+
+main() {
+ print(E1);
+ print(E2);
+ print(E3);
+ print(E4);
+}
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t10.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t10.dart
new file mode 100644
index 0000000..4b088a5
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t10.dart
@@ -0,0 +1,99 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It’s currently a compile-time error for a class to implement,
+/// extend or mix-in the Enum class.
+///
+/// Because we want to allow interfaces and mixins that are intended to be
+/// applied to enum declarations, and therefore to assume Enum to be a
+/// superclass, we loosen that restriction to:
+///
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
+///
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
+///
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
+///
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
+/// which implements Enum, while making it valid to declare abstract class
+/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
+///
+/// @description Check that it's a compile-time error if a class has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+abstract class I1 {
+ int values();
+}
+
+class I2 {
+ List values() => [];
+}
+
+enum E1 implements I1 {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ e1,
+ e2;
+}
+
+enum E2 implements I2 {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ e1,
+ e2;
+}
+
+enum E3 implements I1 {
+ e1(42),
+ e2(0);
+
+ const E3(int i);
+}
+
+enum E4 implements I2 {
+ e1(42),
+ e2(0);
+
+ const E4(int i);
+}
+
+main() {
+ print(E1);
+ print(E2);
+ print(E3);
+ print(E4);
+}
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t11.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t11.dart
new file mode 100644
index 0000000..c544196
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t11.dart
@@ -0,0 +1,99 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It’s currently a compile-time error for a class to implement,
+/// extend or mix-in the Enum class.
+///
+/// Because we want to allow interfaces and mixins that are intended to be
+/// applied to enum declarations, and therefore to assume Enum to be a
+/// superclass, we loosen that restriction to:
+///
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
+///
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
+///
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
+///
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
+/// which implements Enum, while making it valid to declare abstract class
+/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
+///
+/// @description Check that it's a compile-time error if a class has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+abstract class I1 {
+ int get values;
+}
+
+class I2 {
+ List get values => [];
+}
+
+enum E1 implements I1 {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ e1,
+ e2;
+}
+
+enum E2 implements I2 {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ e1,
+ e2;
+}
+
+enum E3 implements I1 {
+ e1(42),
+ e2(0);
+
+ const E3(int i);
+}
+
+enum E4 implements I2 {
+ e1(42),
+ e2(0);
+
+ const E4(int i);
+}
+
+main() {
+ print(E1);
+ print(E2);
+ print(E3);
+ print(E4);
+}
diff --git a/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t12.dart b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t12.dart
new file mode 100644
index 0000000..93b38d2
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/implementing_enum_A03_t12.dart
@@ -0,0 +1,99 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion It’s currently a compile-time error for a class to implement,
+/// extend or mix-in the Enum class.
+///
+/// Because we want to allow interfaces and mixins that are intended to be
+/// applied to enum declarations, and therefore to assume Enum to be a
+/// superclass, we loosen that restriction to:
+///
+/// It's a compile-time error if a non-abstract class has Enum as a
+/// superinterface (directly or transitively) unless it is the corresponding
+/// class of an enum declaration.
+///
+/// It is a compile-time error if a class implements, extends or mixes-in the
+/// class or interface introduced by an enum declaration. (An enum class can’t
+/// be used as a mixin since it is not a mixin declaration and the class has a
+/// superclass other than Object, but we include “mixes-in” for completeness.)
+///
+/// It's a compile-time error if a class or mixin declaration has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values, whether declared or inherited. If any concrete
+/// class implements this interface, it will be an enum declaration class, and
+/// then the values member would conflict with the static values constant getter
+/// that is automatically added to enum declaration classes. Such an instance
+/// values declaration is either useless or wrong, so we disallow it entirely.
+///
+/// It's a compile-time error if a class, mixin or enum declaration has Enum as
+/// a superinterface, and it declares a non-abstract instance member named index.
+/// That member would override the index getter inherited from Enum, and we
+/// currently do not allow that.
+///
+/// Those restrictions allows abstract classes (interfaces) which implements
+/// Enum in order to have the int index; getter member available, and it allows
+/// mixin declarations to use Enum as an on type because mixin declarations
+/// cannot be instantiated directly.
+///
+/// The restrictions still ensure enum values are the only object instances
+/// which implements Enum, while making it valid to declare abstract class
+/// MyInterface implements Enum and mixin MyMixin on Enum for interfaces and
+/// mixins intended to be used in declaring enum classes. It's also impossible
+/// to override or prevent the instance index and static values members without
+/// causing a compile-time error. Say implementing an interface with
+/// `Never get index;` as a member, then because it's not possible to override
+/// `int get index;` from Enum, the resulting class does not implement its
+/// interface and is a compile-time error.
+///
+/// @description Check that it's a compile-time error if a class has Enum as a
+/// superinterface and the interface of the declarations contains an instance
+/// member with the name values
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+abstract class I1 {
+ void set values(int val);
+}
+
+class I2 {
+ void set values(List val) {}
+}
+
+enum E1 implements I1 {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ e1,
+ e2;
+}
+
+enum E2 implements I2 {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ e1,
+ e2;
+}
+
+enum E3 implements I1 {
+ e1(42),
+ e2(0);
+
+ const E3(int i);
+}
+
+enum E4 implements I2 {
+ e1(42),
+ e2(0);
+
+ const E4(int i);
+}
+
+main() {
+ print(E1);
+ print(E2);
+ print(E3);
+ print(E4);
+}
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A05_t01.dart b/LanguageFeatures/Enhanced-Enum/semantics_A05_t01.dart
index 80e2f62..f9dd47a 100644
--- a/LanguageFeatures/Enhanced-Enum/semantics_A05_t01.dart
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A05_t01.dart
@@ -11,7 +11,11 @@
///
/// const Name();
/// (This differs from the default constructor of a normal class declaration by
-/// being constant.)
+/// being constant, and by being added even if a factory constructor is present.
+/// If no generative constructor is declared, and the unnamed constructor is
+/// taken by a factory constructor, there is no way for the enum declaration to
+/// compile successfully, since the declaration must contain at least one enum
+/// value, and that enum value must refer to a generative constructor.)
///
/// @description Check that if no generative constructors were declared, and no
/// unnamed factory constructor was added, a default generative constructor is
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A05_t02.dart b/LanguageFeatures/Enhanced-Enum/semantics_A05_t02.dart
index 8888055..b225ae3 100644
--- a/LanguageFeatures/Enhanced-Enum/semantics_A05_t02.dart
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A05_t02.dart
@@ -11,7 +11,11 @@
///
/// const Name();
/// (This differs from the default constructor of a normal class declaration by
-/// being constant.)
+/// being constant, and by being added even if a factory constructor is present.
+/// If no generative constructor is declared, and the unnamed constructor is
+/// taken by a factory constructor, there is no way for the enum declaration to
+/// compile successfully, since the declaration must contain at least one enum
+/// value, and that enum value must refer to a generative constructor.)
///
/// @description Check that if a generative constructors was declared then a
/// default generative constructor is not added
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A05_t03.dart b/LanguageFeatures/Enhanced-Enum/semantics_A05_t03.dart
index 73b80a3..681d2ce 100644
--- a/LanguageFeatures/Enhanced-Enum/semantics_A05_t03.dart
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A05_t03.dart
@@ -11,7 +11,11 @@
///
/// const Name();
/// (This differs from the default constructor of a normal class declaration by
-/// being constant.)
+/// being constant, and by being added even if a factory constructor is present.
+/// If no generative constructor is declared, and the unnamed constructor is
+/// taken by a factory constructor, there is no way for the enum declaration to
+/// compile successfully, since the declaration must contain at least one enum
+/// value, and that enum value must refer to a generative constructor.)
///
/// @description Check that if unnamed factory constructor was declared then a
/// default generative constructor is not added
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A05_t04.dart b/LanguageFeatures/Enhanced-Enum/semantics_A05_t04.dart
index 2f55e0f..8408e62 100644
--- a/LanguageFeatures/Enhanced-Enum/semantics_A05_t04.dart
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A05_t04.dart
@@ -11,7 +11,11 @@
///
/// const Name();
/// (This differs from the default constructor of a normal class declaration by
-/// being constant.)
+/// being constant, and by being added even if a factory constructor is present.
+/// If no generative constructor is declared, and the unnamed constructor is
+/// taken by a factory constructor, there is no way for the enum declaration to
+/// compile successfully, since the declaration must contain at least one enum
+/// value, and that enum value must refer to a generative constructor.)
///
/// @description Check that if unnamed generative constructor was declared, then
/// no default constructor is added
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A05_t05.dart b/LanguageFeatures/Enhanced-Enum/semantics_A05_t05.dart
new file mode 100644
index 0000000..310cfd1
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A05_t05.dart
@@ -0,0 +1,42 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion The semantics of such an enum declaration, E, is defined as
+/// introducing a (semantic) class, C, just like a similar class declaration.
+/// ...
+/// Default constructor: If no generative constructors were declared, and no
+/// unnamed factory constructor was added, a default generative constructor is
+/// added:
+///
+/// const Name();
+/// (This differs from the default constructor of a normal class declaration by
+/// being constant, and by being added even if a factory constructor is present.
+/// If no generative constructor is declared, and the unnamed constructor is
+/// taken by a factory constructor, there is no way for the enum declaration to
+/// compile successfully, since the declaration must contain at least one enum
+/// value, and that enum value must refer to a generative constructor.)
+///
+/// @description Check that enum declaration must contain at least one enum
+/// value
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+enum E1 {
+}
+//^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+enum E2 {
+ const E2();
+//^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ print(E1);
+ print(E2);
+}
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A07_t01.dart b/LanguageFeatures/Enhanced-Enum/semantics_A07_t01.dart
index d9cefe8..1197fc8 100644
--- a/LanguageFeatures/Enhanced-Enum/semantics_A07_t01.dart
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A07_t01.dart
@@ -2,11 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-/// @assertion Type inference is applied to the resulting constructor
-/// invocations, with no context type, where necessary, so omitted type
-/// arguments to a generic enum class are filled in by type inference, using the
-/// type of arguments, if any, and then the type of the constant variable is the
-/// static type of the constant object creation expression.
+/// @assertion The resulting constructor invocations are subject to type
+/// inference, using the empty context type. This implies that inferred type
+/// arguments to the constructor invocation itself may depend on the types of
+/// the argument expressions of args. The type of the constant variable is the
+/// static type of the resulting constant object creation expression.
///
/// @description Check that omitted type arguments to a generic enum class are
/// filled in by type inference, using the type of arguments
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A08_t01.dart b/LanguageFeatures/Enhanced-Enum/semantics_A08_t01.dart
index e366fe5..ffcf1ce 100644
--- a/LanguageFeatures/Enhanced-Enum/semantics_A08_t01.dart
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A08_t01.dart
@@ -2,12 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-/// @assertion Static `values` list: If the class does not declare or inherit a
-/// member with base-name `values`, a static constant variable named `values` is
-/// added as by the declaration `static const List<Name> values = [id1, …, idn];`
-/// where `id1…idn` are the names of the enum entries of the enum declaration in
-/// source/index order. If `Name` is generic, the `List<Name>` instantiates
-/// `Name` to its bounds.
+/// @assertion Static values list: A static constant variable named values is
+/// added as by the declaration static const List<Name> values = [id1, …, idn];
+/// where id1…idn are the names of the enum entries of the enum declaration in
+/// source/index order. If Name is generic, the List<Name> instantiates Name to
+/// its bounds.
///
/// @description Check that static constant named `values` is added
/// @author sgrekhov@unipro.ru
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A08_t02.dart b/LanguageFeatures/Enhanced-Enum/semantics_A08_t02.dart
index 69a4b53..fd88efc 100644
--- a/LanguageFeatures/Enhanced-Enum/semantics_A08_t02.dart
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A08_t02.dart
@@ -2,12 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-/// @assertion Static `values` list: If the class does not declare or inherit a
-/// member with base-name `values`, a static constant variable named `values` is
-/// added as by the declaration `static const List<Name> values = [id1, …, idn];`
-/// where `id1…idn` are the names of the enum entries of the enum declaration in
-/// source/index order. If `Name` is generic, the `List<Name>` instantiates
-/// `Name` to its bounds.
+/// @assertion Static values list: A static constant variable named values is
+/// added as by the declaration static const List<Name> values = [id1, …, idn];
+/// where id1…idn are the names of the enum entries of the enum declaration in
+/// source/index order. If Name is generic, the List<Name> instantiates Name to
+/// its bounds.
///
/// @description Check that if `Name` is generic, the `List<Name>` instantiates
/// it to its bounds.