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

Unified Diff: lib/binary/ast_from_binary.dart

Issue 2439043002: Introduce Substitution class and Supertype class. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « lib/ast.dart ('k') | lib/binary/ast_to_binary.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/binary/ast_from_binary.dart
diff --git a/lib/binary/ast_from_binary.dart b/lib/binary/ast_from_binary.dart
index f10598e14238389be48d951321ad86930a842159..40a178b01eac1d2088269a360532ca096d93538f 100644
--- a/lib/binary/ast_from_binary.dart
+++ b/lib/binary/ast_from_binary.dart
@@ -329,8 +329,8 @@ class BinaryBuilder {
node.annotations = readAnnotationList(node);
debugPath.add(node.name ?? 'normal-class');
readAndPushTypeParameterList(node.typeParameters, node);
- node.supertype = readDartTypeOption();
- _fillNonTreeNodeList(node.implementedTypes, readDartType);
+ node.supertype = readSupertypeOption();
+ _fillNonTreeNodeList(node.implementedTypes, readSupertype);
_fillLazilyLoadedList(node.fields, (int tag, int index) {
readField(loader.getClassMemberReference(node, tag, index), tag);
});
@@ -355,8 +355,8 @@ class BinaryBuilder {
node.annotations = readAnnotationList(node);
debugPath.add(node.name ?? 'mixin-class');
readAndPushTypeParameterList(node.typeParameters, node);
- node.supertype = readDartType();
- node.mixedInType = readDartType();
+ node.supertype = readSupertype();
+ node.mixedInType = readSupertype();
_fillNonTreeNodeList(node.implementedTypes, readDartType);
_fillLazilyLoadedList(node.constructors, (int tag, int index) {
readConstructor(loader.getClassMemberReference(node, tag, index), tag);
@@ -803,6 +803,19 @@ class BinaryBuilder {
return new Block(body);
}
+ Supertype readSupertype() {
+ InterfaceType type = readDartType();
+ return new Supertype(type.classNode, type.typeArguments);
+ }
+
+ Supertype readSupertypeOption() {
+ return readAndCheckOptionTag() ? readSupertype() : null;
+ }
+
+ List<Supertype> readSupertypeList() {
+ return new List<Supertype>.generate(readUInt(), (i) => readSupertype());
+ }
+
List<DartType> readDartTypeList() {
return new List<DartType>.generate(readUInt(), (i) => readDartType());
}
« no previous file with comments | « lib/ast.dart ('k') | lib/binary/ast_to_binary.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698