Index: pkg/compiler/lib/src/dart_backend/placeholder_collector.dart |
diff --git a/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart b/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart |
index 7b694626a3f810c0533299b465da103094e2ca22..694b62379db603a5b0c8af8c90592fb6a26579ea 100644 |
--- a/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart |
+++ b/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart |
@@ -345,6 +345,14 @@ class PlaceholderCollector extends Visitor { |
if (library.isPlatformLibrary && !element.isTopLevel) { |
return; |
} |
+ |
+ ClassElement cls = element.enclosingClass; |
+ if (cls != null && cls.isEnumClass) { |
+ // Enums and enum values cannot be changed, since the semantics of |
+ // `toString` is defined by the names of the declarations. |
+ return; |
+ } |
+ |
if (element.isGetter || element.isSetter) { |
element = (element as FunctionElement).abstractField; |
} |