Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(606)

Unified Diff: pkg/compiler/lib/src/serialization/type_serialization.dart

Issue 2121743002: Support serialization of generic methods. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Don't serialize code with compile time errors. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
« no previous file with comments | « pkg/compiler/lib/src/serialization/modelz.dart ('k') | tests/compiler/dart2js/serialization/equivalence_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698