Fixes #1258. More Enhanced Enums semantics tests added
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A05_t04.dart b/LanguageFeatures/Enhanced-Enum/semantics_A05_t04.dart
new file mode 100644
index 0000000..2f55e0f
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A05_t04.dart
@@ -0,0 +1,45 @@
+// 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.)
+///
+/// @description Check that if unnamed generative constructor was declared, then
+/// no default constructor is added
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+import "../../Utils/expect.dart";
+
+enum E1 {
+  e1,
+  e2;
+
+  final String? log;
+  const E1() : log = "called";
+}
+
+enum E2 {
+  e1(),
+  e2();
+
+  final String? log;
+  const E2() : log = "called";
+}
+
+main() {
+  Expect.equals("called", E1.e1.log);
+  Expect.equals("called", E1.e2.log);
+  Expect.equals("called", E2.e1.log);
+  Expect.equals("called", E2.e2.log);
+}
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A06_t01.dart b/LanguageFeatures/Enhanced-Enum/semantics_A06_t01.dart
index b878735..a6f1325 100644
--- a/LanguageFeatures/Enhanced-Enum/semantics_A06_t01.dart
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A06_t01.dart
@@ -25,9 +25,7 @@
 /// where args are considered as occurring in a const context, and it’s a
 /// compile-time error if they are then not compile-time constants.
 ///
-/// @description Check that if no generative constructors were declared, and no
-/// unnamed factory constructor was added, a default generative constructor is
-/// added
+/// @description Check enum's values name and index
 /// @Issue 48179, 48181
 /// @author sgrekhov@unipro.ru
 
@@ -58,15 +56,15 @@
   Expect.equals(0, E1.e1.index);
   Expect.equals(1, E1.e2.index);
   Expect.equals(2, E1.e3.index);
-  Expect.equals("E1.e1", E1.e1.toString());
-  Expect.equals("E1.e2", E1.e2.toString());
-  Expect.equals("E1.e3", E1.e3.toString());
+  Expect.equals("e1", EnumName(E1.e1).name);
+  Expect.equals("e2", EnumName(E1.e2).name);
+  Expect.equals("e3", EnumName(E1.e3).name);
   Expect.equals(0, E2.e1.index);
   Expect.equals(1, E2.e2.index);
   Expect.equals(2, E2.e3.index);
-  Expect.equals("E2.e1", E2.e1.toString());
-  Expect.equals("E2.e2", E2.e2.toString());
-  Expect.equals("E2.e3", E2.e3.toString());
+  Expect.equals("e1", EnumName(E2.e1).name);
+  Expect.equals("e2", EnumName(E2.e2).name);
+  Expect.equals("e3", EnumName(E2.e3).name);
   Expect.equals("Lily was here", E2.e1.s);
   Expect.equals("Lily was here", E2.e2.s);
   Expect.equals("Lily was here", E2.e3.s);
@@ -74,6 +72,10 @@
   Expect.isNull(E2.e2.val);
   Expect.isNull(E2.e3.val);
 
-  const EE1 = E1.e1;
-  const EE2 = E2.e1;
+  Expect.equals(E1.e1, E1.f(0));
+  Expect.equals(E1.e2, E1.f(1));
+  Expect.equals(E1.e3, E1.f(2));
+  Expect.equals(E2.e1, E2.f(0));
+  Expect.equals(E2.e2, E2.f(1));
+  Expect.equals(E2.e3, E2.f(2));
 }
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A06_t02.dart b/LanguageFeatures/Enhanced-Enum/semantics_A06_t02.dart
index ef8fcd1..eabd8f4 100644
--- a/LanguageFeatures/Enhanced-Enum/semantics_A06_t02.dart
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A06_t02.dart
@@ -1,58 +1,73 @@
-// Copyright (c) 2021, the Dart project authors.  Please see the AUTHORS file
+// 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 Also a static constant named values is added as:
+/// @assertion The semantics of such an enum declaration, E, is defined as
+/// introducing a (semantic) class, C, just like a similar class declaration.
+/// ...
+/// Enum values: For each <enumEntry> with name id and index i in the
+/// comma-separated list of enum entries, a constant value is created, and a
+/// static constant variable named id is created in C with that value. All the
+/// constant values are associated, in some implementation dependent way, with
 ///
-/// 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 it to bounds.
+/// their name id as a string "id",
 ///
-/// @description Check that if Name is generic, the List<Name> instantiates it
-/// to bounds.
+/// their index i as an int, and
+/// their enum class’s name as a string, "Name",
+/// all of which is accessible to the toString and index member of Enum, and to
+/// the EnumName.name extension getter. The values are computed as follows.
+///
+/// id ↦ Name() (no arguments, equivalent to empty argument list)
+/// id(args) ↦ Name(args)
+/// id<types>(args) ↦ Name<types>(args)
+/// id.named(args) ↦ Name._$named(args)
+/// id<types>.named(args) ↦ Name<types>._$named(args)
+/// where args are considered as occurring in a const context, and it’s a
+/// compile-time error if they are then not compile-time constants.
+///
+/// @description Check enum's values name and index. Test `id(args)` case
 /// @author sgrekhov@unipro.ru
 
 // SharedOptions=--enable-experiment=enhanced-enums
 
 import "../../Utils/expect.dart";
 
-class A {
-  const A();
+enum E1 {
+  e1(1, "1"),
+  e2(2, "2");
+
+  const E1(this.i, this.s);
+
+  final int i;
+  final String s;
 }
 
-class B extends A {
-  const B();
-}
+enum E2 {
+  e1(21, "21"),
+  e2(22, "22");
 
-class C extends A {
-  const C();
-}
+  const E2(int i1, String s1) : this.i = i1, this.s = s1;
 
-enum E<T extends A> {
-  e1<A>(),
-  e2<B>(),
-  e3<C>();
+  final int i;
+  final String s;
 }
 
 main() {
-  Expect.isTrue(E.values[0] is E<A>);
-  Expect.isFalse(E.values[0] is E<B>);
-  Expect.isFalse(E.values[0] is E<C>);
-  Expect.runtimeIsType<E<A>>(E.values[0]);
-  Expect.runtimeIsNotType<E<B>>(E.values[0]);
-  Expect.runtimeIsNotType<E<C>>(E.values[0]);
+  Expect.equals(1, E1.e1.i);
+  Expect.equals("1", E1.e1.s);
+  Expect.equals(2, E1.e2.i);
+  Expect.equals("2", E1.e2.s);
+  Expect.equals(21, E2.e1.i);
+  Expect.equals("21", E2.e1.s);
+  Expect.equals(22, E2.e2.i);
+  Expect.equals("22", E2.e2.s);
 
-  Expect.isTrue(E.values[1] is E<A>);
-  Expect.isTrue(E.values[1] is E<B>);
-  Expect.isFalse(E.values[1] is E<C>);
-  Expect.runtimeIsType<E<A>>(E.values[1]);
-  Expect.runtimeIsType<E<B>>(E.values[1]);
-  Expect.runtimeIsNotType<E<C>>(E.values[1]);
-
-  Expect.isTrue(E.values[2] is E<A>);
-  Expect.isFalse(E.values[2] is E<B>);
-  Expect.isTrue(E.values[2] is E<C>);
-  Expect.runtimeIsType<E<A>>(E.values[2]);
-  Expect.runtimeIsNotType<E<B>>(E.values[2]);
-  Expect.runtimeIsType<E<C>>(E.values[2]);
-}
\ No newline at end of file
+  Expect.equals(0, E1.e1.index);
+  Expect.equals(1, E1.e2.index);
+  Expect.equals("e1", EnumName(E1.e1).name);
+  Expect.equals("e2", EnumName(E1.e2).name);
+  Expect.equals(0, E2.e1.index);
+  Expect.equals(1, E2.e2.index);
+  Expect.equals("e1", EnumName(E2.e1).name);
+  Expect.equals("e2", EnumName(E2.e2).name);
+}
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A06_t03.dart b/LanguageFeatures/Enhanced-Enum/semantics_A06_t03.dart
new file mode 100644
index 0000000..8908da0
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A06_t03.dart
@@ -0,0 +1,60 @@
+// 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.
+/// ...
+/// Enum values: For each <enumEntry> with name id and index i in the
+/// comma-separated list of enum entries, a constant value is created, and a
+/// static constant variable named id is created in C with that value. All the
+/// constant values are associated, in some implementation dependent way, with
+///
+/// their name id as a string "id",
+///
+/// their index i as an int, and
+/// their enum class’s name as a string, "Name",
+/// all of which is accessible to the toString and index member of Enum, and to
+/// the EnumName.name extension getter. The values are computed as follows.
+///
+/// id ↦ Name() (no arguments, equivalent to empty argument list)
+/// id(args) ↦ Name(args)
+/// id<types>(args) ↦ Name<types>(args)
+/// id.named(args) ↦ Name._$named(args)
+/// id<types>.named(args) ↦ Name<types>._$named(args)
+/// where args are considered as occurring in a const context, and it’s a
+/// compile-time error if they are then not compile-time constants.
+///
+/// @description Check enum's values name and index.
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+import "../../Utils/expect.dart";
+
+enum E1<T1 extends num, T2> {
+  e1<int, String>(1, "1"),
+  e2<int, int>(2, 3);
+
+  const E1(this.i, this.s);
+
+  final T1 t1;
+  final T2 t2;
+}
+
+
+main() {
+  Expect.equals(1, E1.e1.t1);
+  Expect.equals("1", E1.e1.t2);
+  Expect.equals(2, E1.e2.t1);
+  Expect.equals(3, E1.e2.t2);
+
+  Expect.equals(0, E1.e1.index);
+  Expect.equals(1, E1.e2.index);
+  Expect.equals("e1", EnumName(E1.e1).name);
+  Expect.equals("e2", EnumName(E1.e2).name);
+  Expect.equals(0, E2.e1.index);
+  Expect.equals(1, E2.e2.index);
+  Expect.equals("e1", EnumName(E2.e1).name);
+  Expect.equals("e2", EnumName(E2.e2).name);
+}
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A06_t04.dart b/LanguageFeatures/Enhanced-Enum/semantics_A06_t04.dart
new file mode 100644
index 0000000..fbe3f4d
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A06_t04.dart
@@ -0,0 +1,67 @@
+// 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.
+/// ...
+/// Enum values: For each <enumEntry> with name id and index i in the
+/// comma-separated list of enum entries, a constant value is created, and a
+/// static constant variable named id is created in C with that value. All the
+/// constant values are associated, in some implementation dependent way, with
+///
+/// their name id as a string "id",
+///
+/// their index i as an int, and
+/// their enum class’s name as a string, "Name",
+/// all of which is accessible to the toString and index member of Enum, and to
+/// the EnumName.name extension getter. The values are computed as follows.
+///
+/// id ↦ Name() (no arguments, equivalent to empty argument list)
+/// id(args) ↦ Name(args)
+/// id<types>(args) ↦ Name<types>(args)
+/// id.named(args) ↦ Name._$named(args)
+/// id<types>.named(args) ↦ Name<types>._$named(args)
+/// where args are considered as occurring in a const context, and it’s a
+/// compile-time error if they are then not compile-time constants.
+///
+/// @description Check computing of enum values
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+import "../../Utils/expect.dart";
+
+enum E1 {
+  e1,
+  e2(),
+  e3.named();
+
+  final String log;
+  const E1() : log = "E1()";
+  const E1.named() : log = "E1.named()";
+}
+
+enum E2<T extends num> {
+  e1,
+  e2(),
+  e3.named(),
+  e4<int>(),
+  e5<double>.named();
+
+  final String log;
+  const E2() : log = "E2()";
+  const E2.named() : log = "E2.named()";
+}
+
+main() {
+  Expect.equals("E1()", E1.e1.log);
+  Expect.equals("E1()", E1.e2.log);
+  Expect.equals("E1.named()", E1.e3.log);
+
+  Expect.equals("E2()", E2.e1.log);
+  Expect.equals("E2()", E2.e2.log);
+  Expect.equals("E2.named()", E2.e3.log);
+  Expect.equals("E2()", E2.e4.log);
+  Expect.equals("E2.named()", E2.e5.log);
+}
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A06_t05.dart b/LanguageFeatures/Enhanced-Enum/semantics_A06_t05.dart
new file mode 100644
index 0000000..c07ef3f
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A06_t05.dart
@@ -0,0 +1,70 @@
+// 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.
+/// ...
+/// Enum values: For each <enumEntry> with name id and index i in the
+/// comma-separated list of enum entries, a constant value is created, and a
+/// static constant variable named id is created in C with that value. All the
+/// constant values are associated, in some implementation dependent way, with
+///
+/// their name id as a string "id",
+///
+/// their index i as an int, and
+/// their enum class’s name as a string, "Name",
+/// all of which is accessible to the toString and index member of Enum, and to
+/// the EnumName.name extension getter. The values are computed as follows.
+///
+/// id ↦ Name() (no arguments, equivalent to empty argument list)
+/// id(args) ↦ Name(args)
+/// id<types>(args) ↦ Name<types>(args)
+/// id.named(args) ↦ Name._$named(args)
+/// id<types>.named(args) ↦ Name<types>._$named(args)
+/// where args are considered as occurring in a const context, and it’s a
+/// compile-time error if they are then not compile-time constants.
+///
+/// @description Check computing of enum values
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+import "../../Utils/expect.dart";
+
+enum E1 {
+  e1(1, "2"),
+  e2.named(3, "4");
+
+  final String log;
+  final int val1;
+  final String val2;
+  const E1(this.val1, this.val2) : log = "E1()";
+  const E1.named(this.val1, this.val2) : log = "E1.named()";
+}
+
+enum E2<T1 extends num, T2> {
+  e1<int, String>(42, "Lily was here"),
+  e2<double, bool>.named(3.14, true);
+
+  final String log;
+  final T1 val1;
+  final T2 val2;
+  const E2(this.val1, this.val2) : log = "E2()";
+  const E2.named(this.val1, this.val2) : log = "E2.named()";
+}
+
+main() {
+  Expect.equals("E1()", E1.e1.log);
+  Expect.equals("E1.named()", E1.e2.log);
+  Expect.equals("E2()", E2.e1.log);
+  Expect.equals("E2.named()", E2.e2.log);
+  Expect.equals(1, E1.e1.val1);
+  Expect.equals("2", E1.e1.val2);
+  Expect.equals(3, E1.e2.val1);
+  Expect.equals("4", E1.e2.val2);
+  Expect.equals(42, E2.e1.val1);
+  Expect.equals("Lily was here", E2.e1.val2);
+  Expect.equals(3.14, E2.e2.val1);
+  Expect.equals(true, E2.e2.val2);
+}
\ No newline at end of file
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A06_t07.dart b/LanguageFeatures/Enhanced-Enum/semantics_A06_t07.dart
new file mode 100644
index 0000000..ecd3bf2
--- /dev/null
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A06_t07.dart
@@ -0,0 +1,74 @@
+// 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.
+/// ...
+/// Enum values: For each <enumEntry> with name id and index i in the
+/// comma-separated list of enum entries, a constant value is created, and a
+/// static constant variable named id is created in C with that value. All the
+/// constant values are associated, in some implementation dependent way, with
+///
+/// their name id as a string "id",
+///
+/// their index i as an int, and
+/// their enum class’s name as a string, "Name",
+/// all of which is accessible to the toString and index member of Enum, and to
+/// the EnumName.name extension getter. The values are computed as follows.
+///
+/// id ↦ Name() (no arguments, equivalent to empty argument list)
+/// id(args) ↦ Name(args)
+/// id<types>(args) ↦ Name<types>(args)
+/// id.named(args) ↦ Name._$named(args)
+/// id<types>.named(args) ↦ Name<types>._$named(args)
+/// where args are considered as occurring in a const context, and it’s a
+/// compile-time error if they are then not compile-time constants.
+///
+/// @description Check that it is a compile-time error if args are not
+/// compile-time constants
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=enhanced-enums
+
+int x = 1;
+String y = "s";
+double z = 3.14;
+
+enum E1 {
+  e1(x, "2"),
+//   ^
+// [analyzer] unspecified
+// [cfe] unspecified
+  e2.named(3, y);
+//            ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+  final int val1;
+  final String val2;
+  const E1(this.val1, this.val2);
+  const E1.named(this.val1, this.val2);
+}
+
+enum E2<T1 extends num, T2> {
+  e1<int, String>(x, "Lily was here"),
+//                ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+  e2<double, bool>.named(z, true);
+//                       ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+  final T1 val1;
+  final T2 val2;
+  const E2(this.val1, this.val2);
+  const E2.named(this.val1, this.val2);
+}
+
+main() {
+  print(E1.e1);
+  print(E2.e1);
+}
\ No newline at end of file
diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A07_t01.dart b/LanguageFeatures/Enhanced-Enum/semantics_A07_t01.dart
index 5b526d0..d9cefe8 100644
--- a/LanguageFeatures/Enhanced-Enum/semantics_A07_t01.dart
+++ b/LanguageFeatures/Enhanced-Enum/semantics_A07_t01.dart
@@ -1,40 +1,36 @@
-// Copyright (c) 2021, the Dart project authors.  Please see the AUTHORS file
+// 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 If the resulting class would have any naming conflicts, or other
-/// compile-time errors, the enum declaration is invalid and a compile-time
-/// error occurs.
+/// @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.
 ///
-/// @description Check that if the resulting class would have any naming
-/// conflicts then compile-time error occurs.
+/// @description Check that omitted type arguments to a generic enum class are
+/// filled in by type inference, using the type of arguments
 /// @author sgrekhov@unipro.ru
 
 // SharedOptions=--enable-experiment=enhanced-enums
 
-enum E1 {
-  e1,
-  e2,
-  e3;
+import "../../Utils/expect.dart";
 
-  final int values = 42;
-//          ^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-}
+enum E<T> {
+  e1(1),
+  e2("1"),
+  e3(true);
 
-enum E2<T> {
-  e1<int>(42),
-  e2<String>("42"),
-  e3<bool>(false);
-
-  final List<E2> values = [e1, e2, e3];
-//               ^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
+  final T t;
+  const E(this.t);
 }
 
 main() {
-  E1.e1;
-  E2.e1;
+  Expect.equals(1, E.e1.t);
+  Expect.equals("1", E.e2.t);
+  Expect.equals(true, E.e3.t);
+
+  Expect.equals("int", E.e1.t.runtimeType.toString());
+  Expect.equals("String", E.e2.t.runtimeType.toString());
+  Expect.equals("bool", E.e3.t.runtimeType.toString());
 }