Files
sdk/pkg/front_end/testcases/rasta/enum.dart.direct.expect
T
Samir Jindel 031a7ffe41 [kernel] Improve Enum representation.
Dart2JS and the VM prefer for Enum names to be stored inline in the Enum
object to avoid having the static array of all Enum values. A base class
for Enums is provided to avoid repeating the common fields and accessors
between Enum definitions.

Bug:
Change-Id: I783f863015b45f13317fda06e627d14844fe2ddf
Reviewed-on: https://dart-review.googlesource.com/16526
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-27 12:10:53 +00:00

18 lines
678 B
Plaintext

library;
import self as self;
import "dart:core" as core;
class Foo extends core::Object {
final field core::int index;
final field core::String _name;
static const field core::List<self::Foo> values = const <self::Foo>[self::Foo::ec1, self::Foo::ec2];
static const field self::Foo ec1 = const self::Foo::•(0, "Foo.ec1");
static const field self::Foo ec2 = const self::Foo::•(1, "Foo.ec2");
const constructor •(core::int index, core::String _name) → void
: self::Foo::index = index, self::Foo::_name = _name, super core::Object::•()
;
method toString() → core::String
return this.{=self::Foo::_name};
}
static method main() → dynamic {}