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

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: Fix problem on redirecting factories. 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 7ae253089dd72e1bef9dd3a429b26c8a89991ef4..fc9ee7040d644ff23c289cd09ebb631b67c41ad7 100644
--- a/pkg/compiler/lib/src/resolution/enum_creator.dart
+++ b/pkg/compiler/lib/src/resolution/enum_creator.dart
@@ -228,6 +228,7 @@ class EnumCreator {
constructor.functionSignatureCache = constructorSignature;
enumClass.addMember(constructor, compiler);
+ List<FieldElement> enumValues = <FieldElement>[];
VariableList variableList =
new VariableList(builder.modifiers(isStatic: true, isConst: true));
variableList.type = enumType;
@@ -256,6 +257,7 @@ class EnumCreator {
EnumFieldElementX field = new EnumFieldElementX(
name, enumClass, variableList, definition, initializer);
+ enumValues.add(field);
enumClass.addMember(field, compiler);
index++;
}
@@ -297,5 +299,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