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 24a46ae27f84757df04aac019727a6bd9b99f8e5..ed94ade3e780460047b23db8bf6e1e5495bb36bf 100644 |
--- a/pkg/compiler/lib/src/serialization/type_serialization.dart |
+++ b/pkg/compiler/lib/src/serialization/type_serialization.dart |
@@ -5,6 +5,7 @@ |
library dart2js.serialization.types; |
import '../dart_types.dart'; |
+import '../elements/elements.dart'; |
import 'serialization.dart'; |
import 'keys.dart'; |
@@ -24,6 +25,8 @@ class TypeSerializer extends DartTypeVisitor<dynamic, ObjectEncoder> { |
void visitTypeVariableType(TypeVariableType type, ObjectEncoder encoder) { |
encoder.setElement(Key.ELEMENT, type.element); |
+ encoder.setBool( |
+ Key.IS_METHOD_TYPE_VARIABLE_TYPE, type is MethodTypeVariableType); |
} |
void visitFunctionType(FunctionType type, ObjectEncoder encoder) { |
@@ -76,7 +79,11 @@ class TypeDeserializer { |
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)); |
+ TypeVariableElement element = decoder.getElement(Key.ELEMENT); |
+ if (decoder.getBool(Key.IS_METHOD_TYPE_VARIABLE_TYPE)) { |
+ return new MethodTypeVariableType(element); |
+ } |
+ return new TypeVariableType(element); |
case TypeKind.TYPEDEF: |
return new TypedefType(decoder.getElement(Key.ELEMENT), |
decoder.getTypes(Key.TYPE_ARGUMENTS, isOptional: true)); |