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

Side by Side Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 1954203002: Keep all type arguments in summaries - dynamic or not. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: tweaks Created 4 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/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer/lib/src/summary/summarize_ast.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 4
5 /** 5 /**
6 * This library is capable of producing linked summaries from unlinked 6 * This library is capable of producing linked summaries from unlinked
7 * ones (or prelinked ones). It functions by building a miniature 7 * ones (or prelinked ones). It functions by building a miniature
8 * element model to represent the contents of the summaries, and then 8 * element model to represent the contents of the summaries, and then
9 * scanning the element model to gather linked information and adding 9 * scanning the element model to gather linked information and adding
10 * it to the summary data structures. 10 * it to the summary data structures.
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // TODO(paulberry): implement other cases. 221 // TODO(paulberry): implement other cases.
222 throw new UnimplementedError('${element.runtimeType}'); 222 throw new UnimplementedError('${element.runtimeType}');
223 } 223 }
224 // TODO(paulberry): implement other cases. 224 // TODO(paulberry): implement other cases.
225 throw new UnimplementedError('${type.runtimeType}'); 225 throw new UnimplementedError('${type.runtimeType}');
226 } 226 }
227 227
228 /** 228 /**
229 * Store the given [typeArguments] in [encodedType], using [compilationUnit] and 229 * Store the given [typeArguments] in [encodedType], using [compilationUnit] and
230 * [typeParameterContext] to serialize them. 230 * [typeParameterContext] to serialize them.
231 *
232 * Trailing arguments of type `dynamic` are dropped.
233 */ 231 */
234 void _storeTypeArguments( 232 void _storeTypeArguments(
235 List<DartType> typeArguments, 233 List<DartType> typeArguments,
236 EntityRefBuilder encodedType, 234 EntityRefBuilder encodedType,
237 CompilationUnitElementInBuildUnit compilationUnit, 235 CompilationUnitElementInBuildUnit compilationUnit,
238 TypeParameterizedElementForLink typeParameterContext) { 236 TypeParameterizedElementForLink typeParameterContext) {
239 int count = typeArguments.length; 237 int count = typeArguments.length;
240 while (count > 0) { 238 List<EntityRefBuilder> encodedTypeArguments =
241 if (typeArguments[count - 1].isDynamic) { 239 new List<EntityRefBuilder>(count);
242 count--; 240 for (int i = 0; i < count; i++) {
243 } else { 241 encodedTypeArguments[i] = _createLinkedType(
244 List<EntityRefBuilder> encodedTypeArguments = 242 typeArguments[i], compilationUnit, typeParameterContext);
245 new List<EntityRefBuilder>(count);
246 for (int i = 0; i < count; i++) {
247 encodedTypeArguments[i] = _createLinkedType(
248 typeArguments[i], compilationUnit, typeParameterContext);
249 }
250 encodedType.typeArguments = encodedTypeArguments;
251 break;
252 }
253 } 243 }
244 encodedType.typeArguments = encodedTypeArguments;
254 } 245 }
255 246
256 /** 247 /**
257 * Type of the callback used by [link] and [relink] to request 248 * Type of the callback used by [link] and [relink] to request
258 * [LinkedLibrary] objects from other build units. 249 * [LinkedLibrary] objects from other build units.
259 */ 250 */
260 typedef LinkedLibrary GetDependencyCallback(String absoluteUri); 251 typedef LinkedLibrary GetDependencyCallback(String absoluteUri);
261 252
262 /** 253 /**
263 * Type of the callback used by [link] and [relink] to request 254 * Type of the callback used by [link] and [relink] to request
(...skipping 4281 matching lines...) Expand 10 before | Expand all | Expand 10 after
4545 * there are no type parameters in scope. 4536 * there are no type parameters in scope.
4546 */ 4537 */
4547 TypeParameterizedElementForLink get _typeParameterContext; 4538 TypeParameterizedElementForLink get _typeParameterContext;
4548 4539
4549 @override 4540 @override
4550 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 4541 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
4551 4542
4552 @override 4543 @override
4553 String toString() => '$enclosingElement.$name'; 4544 String toString() => '$enclosingElement.$name';
4554 } 4545 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698