diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A13_t01.dart b/LanguageFeatures/Enhanced-Enum/semantics_A13_t01.dart index c3ded072e8..f3c64ce946 100644 --- a/LanguageFeatures/Enhanced-Enum/semantics_A13_t01.dart +++ b/LanguageFeatures/Enhanced-Enum/semantics_A13_t01.dart @@ -28,6 +28,7 @@ enum E> { // [cfe] unspecified e1(); } + main() { E.e1; } diff --git a/LanguageFeatures/Enhanced-Enum/semantics_A13_t02.dart b/LanguageFeatures/Enhanced-Enum/semantics_A13_t02.dart new file mode 100644 index 0000000000..01c8737061 --- /dev/null +++ b/LanguageFeatures/Enhanced-Enum/semantics_A13_t02.dart @@ -0,0 +1,29 @@ +// 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. Such errors include, but are not limited to: +/// ... +/// Declaring a generic enum which does not have a regular-bounded +/// instantiate-to-bounds result and that has an enum value declaration omitting +/// the type arguments and not having arguments from which type arguments can be +/// inferred. (For example enum EnumName> { foo; } would +/// introduce an implicit static const foo = EnumName(0, "foo"); declaration +/// where the constructor invocation requires a regular-bounded +/// instantiate-to-bounds result). +/// +/// @description Check that it is no compile-time error to declare a generic +/// enum which does have a regular-bounded instantiate-to-bounds result +/// @author sgrekhov@unipro.ru + +// SharedOptions=--enable-experiment=enhanced-enums + +enum E { + e1(); +} + +main() { + print(E.e1); +}