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

Side by Side Diff: pkg/kernel/lib/binary/ast_from_binary.dart

Issue 2866593003: Add an optional bound to type parameter references (Closed)
Patch Set: Don't leak the bound if it ever becomes non-null Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « pkg/kernel/lib/ast.dart ('k') | pkg/kernel/lib/binary/ast_to_binary.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 library kernel.ast_from_binary; 4 library kernel.ast_from_binary;
5 5
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:typed_data'; 7 import 'dart:typed_data';
8 8
9 import '../ast.dart'; 9 import '../ast.dart';
10 import '../transformations/flags.dart'; 10 import '../transformations/flags.dart';
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 return new FunctionType(positional, returnType, 1077 return new FunctionType(positional, returnType,
1078 typeParameters: typeParameters, 1078 typeParameters: typeParameters,
1079 requiredParameterCount: requiredParameterCount, 1079 requiredParameterCount: requiredParameterCount,
1080 namedParameters: named); 1080 namedParameters: named);
1081 case Tag.SimpleFunctionType: 1081 case Tag.SimpleFunctionType:
1082 var positional = readDartTypeList(); 1082 var positional = readDartTypeList();
1083 var returnType = readDartType(); 1083 var returnType = readDartType();
1084 return new FunctionType(positional, returnType); 1084 return new FunctionType(positional, returnType);
1085 case Tag.TypeParameterType: 1085 case Tag.TypeParameterType:
1086 int index = readUInt(); 1086 int index = readUInt();
1087 return new TypeParameterType(typeParameterStack[index]); 1087 var bound = readDartTypeOption();
1088 return new TypeParameterType(typeParameterStack[index], bound);
1088 default: 1089 default:
1089 throw fail('Invalid dart type tag: $tag'); 1090 throw fail('Invalid dart type tag: $tag');
1090 } 1091 }
1091 } 1092 }
1092 1093
1093 List<TypeParameter> readAndPushTypeParameterList( 1094 List<TypeParameter> readAndPushTypeParameterList(
1094 [List<TypeParameter> list, TreeNode parent]) { 1095 [List<TypeParameter> list, TreeNode parent]) {
1095 int length = readUInt(); 1096 int length = readUInt();
1096 if (length == 0) return list ?? <TypeParameter>[]; 1097 if (length == 0) return list ?? <TypeParameter>[];
1097 if (list == null) { 1098 if (list == null) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 ..fileOffset = offset 1159 ..fileOffset = offset
1159 ..fileEqualsOffset = fileEqualsOffset; 1160 ..fileEqualsOffset = fileEqualsOffset;
1160 } 1161 }
1161 1162
1162 int readOffset() { 1163 int readOffset() {
1163 // Offset is saved as unsigned, 1164 // Offset is saved as unsigned,
1164 // but actually ranges from -1 and up (thus the -1) 1165 // but actually ranges from -1 and up (thus the -1)
1165 return readUInt() - 1; 1166 return readUInt() - 1;
1166 } 1167 }
1167 } 1168 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/ast.dart ('k') | pkg/kernel/lib/binary/ast_to_binary.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698