library test;
import self as self;
import "dart:core" as core;

class E extends core::Object implements core::Enum /*isEnum*/  {
  final field core::int* index;
  final field core::String* _name;
  static const field core::List<self::E*>* values = const <self::E*>[self::E::v1];
  static const field self::E* v1 = const self::E::•(0, "E.v1");
  const constructor •(core::int* index, core::String* _name) → self::E*
    : self::E::index = index, self::E::_name = _name, super core::Object::•()
    ;
  method toString() → core::String*
    return this.{self::E::_name}{core::String*};
  abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
  abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
  abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
  abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
  abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
  abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
  abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
  abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
  abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
}
static final field core::List<self::E*>* x;
static method main() → dynamic
  ;


Extra constant evaluation status:
Evaluated: ListLiteral @ org-dartlang-testcase:///inferred_type_is_enum_values.dart:8:6 -> ListConstant(const <E*>[const E{E.index: 0, E._name: "E.v1"}])
Evaluated: ConstructorInvocation @ org-dartlang-testcase:///inferred_type_is_enum_values.dart:8:10 -> InstanceConstant(const E{E.index: 0, E._name: "E.v1"})
Extra constant evaluation: evaluated: 6, effectively constant: 2
