Index: pkg/compiler/lib/src/serialization/type_serialization.dart |
diff --git a/pkg/compiler/lib/src/serialization/type_serialization.dart b/pkg/compiler/lib/src/serialization/type_serialization.dart |
index 3d4cb9fd353d5ac8cd582d36a9b0032fb4d98743..24a46ae27f84757df04aac019727a6bd9b99f8e5 100644 |
--- a/pkg/compiler/lib/src/serialization/type_serialization.dart |
+++ b/pkg/compiler/lib/src/serialization/type_serialization.dart |
@@ -35,7 +35,9 @@ class TypeSerializer extends DartTypeVisitor<dynamic, ObjectEncoder> { |
encoder.setTypes(Key.NAMED_PARAMETER_TYPES, type.namedParameterTypes); |
} |
- void visitMalformedType(MalformedType type, ObjectEncoder encoder) {} |
+ void visitMalformedType(MalformedType type, ObjectEncoder encoder) { |
+ encoder.setElement(Key.ELEMENT, type.element); |
+ } |
void visitInterfaceType(InterfaceType type, ObjectEncoder encoder) { |
encoder.setElement(Key.ELEMENT, type.element); |
@@ -79,8 +81,11 @@ class TypeDeserializer { |
return new TypedefType(decoder.getElement(Key.ELEMENT), |
decoder.getTypes(Key.TYPE_ARGUMENTS, isOptional: true)); |
case TypeKind.STATEMENT: |
- case TypeKind.MALFORMED_TYPE: |
throw new UnsupportedError("Unexpected type kind '${typeKind}."); |
+ case TypeKind.MALFORMED_TYPE: |
+ // TODO(johnniwinther): Do we need the 'userProvidedBadType' or maybe |
+ // just a toString of it? |
+ return new MalformedType(decoder.getElement(Key.ELEMENT), null); |
case TypeKind.DYNAMIC: |
return const DynamicType(); |
case TypeKind.VOID: |