Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Unified Diff: pkg/compiler/lib/src/resolution/enum_creator.dart

Issue 710343002: Check enums in switch cases. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 fcc179682edea72902cb83327c827a339d076224..8d1a875172dc0aa7f6a020762c53f8a8376e6470 100644
--- a/pkg/compiler/lib/src/resolution/enum_creator.dart
+++ b/pkg/compiler/lib/src/resolution/enum_creator.dart
@@ -198,6 +198,7 @@ class EnumCreator {
constructor.functionSignatureCache = constructorSignature;
enumClass.addMember(constructor, compiler);
+ List<FieldElement> enumValues = <FieldElement>[];
VariableList variableList = new VariableList(builder.staticConstModifiers);
variableList.type = enumType;
int index = 0;
@@ -220,6 +221,7 @@ class EnumCreator {
EnumFieldElementX field = new EnumFieldElementX(
name, enumClass, variableList, definition, initializer);
+ enumValues.add(field);
enumClass.addMember(field, compiler);
index++;
}
@@ -263,5 +265,7 @@ class EnumCreator {
type: new FunctionType(toString, stringType));
toString.functionSignatureCache = toStringSignature;
enumClass.addMember(toString, compiler);
+
+ enumClass.enumValues = enumValues;
}
}

Powered by Google App Engine
This is Rietveld 408576698