Index: pkg/compiler/lib/src/serialization/system.dart |
diff --git a/pkg/compiler/lib/src/serialization/system.dart b/pkg/compiler/lib/src/serialization/system.dart |
index 22ac66b5c247472a4daaa0d68e19768ad2e256be..5e2a24b35fcb2e055f5e6d72f9cdf6c551c9cf24 100644 |
--- a/pkg/compiler/lib/src/serialization/system.dart |
+++ b/pkg/compiler/lib/src/serialization/system.dart |
@@ -217,6 +217,7 @@ class ResolvedAstSerializerPlugin extends SerializerPlugin { |
void onElement(Element element, ObjectEncoder createEncoder(String tag)) { |
assert(invariant(element, element.isDeclaration, |
message: "Element $element must be the declaration")); |
+ if (element.isError) return; |
if (element is MemberElement) { |
assert(invariant(element, resolution.hasResolvedAst(element), |
message: "Element $element must have a resolved ast")); |