Index: pkg/compiler/lib/src/serialization/element_serialization.dart |
diff --git a/pkg/compiler/lib/src/serialization/element_serialization.dart b/pkg/compiler/lib/src/serialization/element_serialization.dart |
index e3d1526e10a1c9046156e7efc0c35dd8a0dd0c3f..6f5dc4d83cd17ded8f670874a3d2e135d65114b3 100644 |
--- a/pkg/compiler/lib/src/serialization/element_serialization.dart |
+++ b/pkg/compiler/lib/src/serialization/element_serialization.dart |
@@ -398,8 +398,8 @@ class FieldSerializer implements ElementSerializer { |
encoder.setType(Key.TYPE, element.type); |
encoder.setBool(Key.IS_FINAL, element.isFinal); |
encoder.setBool(Key.IS_CONST, element.isConst); |
- if (element.isConst) { |
- ConstantExpression constant = element.constant; |
+ ConstantExpression constant = element.constant; |
+ if (constant != null) { |
encoder.setConstant(Key.CONSTANT, constant); |
} |
SerializerUtil.serializeParentRelation(element, encoder); |