blob: ee356c18a84ecf85d3a5ad7c70ef7e8af2b5aa5d [file] [log] [blame]
// Copyright (c) 2021, 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 EnumName extension Null safety
/// Access to the name of an enum value.
/// This method is declared as an extension method instead of an instance method
/// in order to allow enum values to have the name name.
/// The name of the enum value.
/// The name is a string containing the source identifier used to declare the
/// enum value.
/// For example, given a declaration like:
/// enum MyEnum {
/// value1,
/// value2
/// }
/// the result of is the string "value1".
/// @description Check grammar of the enum declaration. Test covariant members
/// @author
// SharedOptions=--enable-experiment=enhanced-enums
import "../../Utils/expect.dart";
enum E<T extends num> {
const E();
const E.named(int x);
main() {