Index: pkg/compiler/lib/src/resolution/enum_creator.dart |
diff --git a/pkg/compiler/lib/src/resolution/enum_creator.dart b/pkg/compiler/lib/src/resolution/enum_creator.dart |
index 93fb9ec932c934fd1176932643e6f05bd6b35d44..6b0acfa4bca4f54a083c9aa986427800c9c7ab17 100644 |
--- a/pkg/compiler/lib/src/resolution/enum_creator.dart |
+++ b/pkg/compiler/lib/src/resolution/enum_creator.dart |
@@ -171,6 +171,29 @@ class AstBuilder { |
} |
} |
+/// This class generates the model for an enum class. |
+/// |
+/// For instance |
+/// |
+/// enum A { b, c, } |
+/// |
+/// is modelled as |
+/// |
+/// class A { |
+/// final int index; |
+/// |
+/// const A(this.index); |
+/// |
+/// String toString() { |
+/// return const <int, A>{0: 'A.b', 1: 'A.c'}[index]; |
+/// } |
+/// |
+/// static const A b = const A(0); |
+/// static const A c = const A(1); |
+/// |
+/// static const List<A> values = const <A>[b, c]; |
+/// } |
+/// |
// TODO(johnniwinther): Avoid creating synthesized ASTs for enums when SSA is |
// removed. |
class EnumCreator { |