| 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 7ea60ffe37a7c461b90355208c862daa91aaca0f..3d4cb9fd353d5ac8cd582d36a9b0032fb4d98743 100644
|
| --- a/pkg/compiler/lib/src/serialization/type_serialization.dart
|
| +++ b/pkg/compiler/lib/src/serialization/type_serialization.dart
|
| @@ -22,25 +22,20 @@ class TypeSerializer extends DartTypeVisitor<dynamic, ObjectEncoder> {
|
|
|
| void visitVoidType(VoidType type, ObjectEncoder encoder) {}
|
|
|
| - void visitTypeVariableType(TypeVariableType type,
|
| - ObjectEncoder encoder) {
|
| + void visitTypeVariableType(TypeVariableType type, ObjectEncoder encoder) {
|
| encoder.setElement(Key.ELEMENT, type.element);
|
| }
|
|
|
| - void visitFunctionType(FunctionType type,
|
| - ObjectEncoder encoder) {
|
| + void visitFunctionType(FunctionType type, ObjectEncoder encoder) {
|
| // TODO(johnniwinther): Support encoding of `type.element`.
|
| encoder.setType(Key.RETURN_TYPE, type.returnType);
|
| encoder.setTypes(Key.PARAMETER_TYPES, type.parameterTypes);
|
| - encoder.setTypes(
|
| - Key.OPTIONAL_PARAMETER_TYPES, type.optionalParameterTypes);
|
| + encoder.setTypes(Key.OPTIONAL_PARAMETER_TYPES, type.optionalParameterTypes);
|
| encoder.setStrings(Key.NAMED_PARAMETERS, type.namedParameters);
|
| encoder.setTypes(Key.NAMED_PARAMETER_TYPES, type.namedParameterTypes);
|
| }
|
|
|
| - void visitMalformedType(MalformedType type, ObjectEncoder encoder) {
|
| -
|
| - }
|
| + void visitMalformedType(MalformedType type, ObjectEncoder encoder) {}
|
|
|
| void visitInterfaceType(InterfaceType type, ObjectEncoder encoder) {
|
| encoder.setElement(Key.ELEMENT, type.element);
|
| @@ -55,12 +50,10 @@ class TypeSerializer extends DartTypeVisitor<dynamic, ObjectEncoder> {
|
| void visitDynamicType(DynamicType type, ObjectEncoder encoder) {}
|
| }
|
|
|
| -
|
| /// Utility class for deserializing [DartType]s.
|
| ///
|
| /// This is used by the [Deserializer].
|
| class TypeDeserializer {
|
| -
|
| /// Deserializes a [DartType] from an [ObjectDecoder].
|
| ///
|
| /// The class is called from the [Deserializer] when a [DartType] needs
|
| @@ -70,26 +63,20 @@ class TypeDeserializer {
|
| TypeKind typeKind = decoder.getEnum(Key.KIND, TypeKind.values);
|
| switch (typeKind) {
|
| case TypeKind.INTERFACE:
|
| - return new InterfaceType(
|
| - decoder.getElement(Key.ELEMENT),
|
| + return new InterfaceType(decoder.getElement(Key.ELEMENT),
|
| decoder.getTypes(Key.TYPE_ARGUMENTS, isOptional: true));
|
| case TypeKind.FUNCTION:
|
| // TODO(johnniwinther): Support decoding of `type.element`.
|
| return new FunctionType.synthesized(
|
| decoder.getType(Key.RETURN_TYPE),
|
| decoder.getTypes(Key.PARAMETER_TYPES, isOptional: true),
|
| - decoder.getTypes(
|
| - Key.OPTIONAL_PARAMETER_TYPES, isOptional: true),
|
| - decoder.getStrings(
|
| - Key.NAMED_PARAMETERS, isOptional: true),
|
| - decoder.getTypes(
|
| - Key.NAMED_PARAMETER_TYPES, isOptional: true));
|
| + decoder.getTypes(Key.OPTIONAL_PARAMETER_TYPES, isOptional: true),
|
| + decoder.getStrings(Key.NAMED_PARAMETERS, isOptional: true),
|
| + decoder.getTypes(Key.NAMED_PARAMETER_TYPES, isOptional: true));
|
| case TypeKind.TYPE_VARIABLE:
|
| - return new TypeVariableType(
|
| - decoder.getElement(Key.ELEMENT));
|
| + return new TypeVariableType(decoder.getElement(Key.ELEMENT));
|
| case TypeKind.TYPEDEF:
|
| - return new TypedefType(
|
| - decoder.getElement(Key.ELEMENT),
|
| + return new TypedefType(decoder.getElement(Key.ELEMENT),
|
| decoder.getTypes(Key.TYPE_ARGUMENTS, isOptional: true));
|
| case TypeKind.STATEMENT:
|
| case TypeKind.MALFORMED_TYPE:
|
| @@ -101,4 +88,3 @@ class TypeDeserializer {
|
| }
|
| }
|
| }
|
| -
|
|
|