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

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: 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
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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // TODO(paulberry): implement other cases. 214 // TODO(paulberry): implement other cases.
215 throw new UnimplementedError('${element.runtimeType}'); 215 throw new UnimplementedError('${element.runtimeType}');
216 } 216 }
217 // TODO(paulberry): implement other cases. 217 // TODO(paulberry): implement other cases.
218 throw new UnimplementedError('${type.runtimeType}'); 218 throw new UnimplementedError('${type.runtimeType}');
219 } 219 }
220 220
221 /** 221 /**
222 * Store the given [typeArguments] in [encodedType], using [compilationUnit] and 222 * Store the given [typeArguments] in [encodedType], using [compilationUnit] and
223 * [typeParameterContext] to serialize them. 223 * [typeParameterContext] to serialize them.
224 *
225 * Trailing arguments of type `dynamic` are dropped.
226 */ 224 */
227 void _storeTypeArguments( 225 void _storeTypeArguments(
228 List<DartType> typeArguments, 226 List<DartType> typeArguments,
229 EntityRefBuilder encodedType, 227 EntityRefBuilder encodedType,
230 CompilationUnitElementInBuildUnit compilationUnit, 228 CompilationUnitElementInBuildUnit compilationUnit,
231 TypeParameterizedElementForLink typeParameterContext) { 229 TypeParameterizedElementForLink typeParameterContext) {
232 int count = typeArguments.length; 230 int count = typeArguments.length;
233 while (count > 0) { 231 List<EntityRefBuilder> encodedTypeArguments =
234 if (typeArguments[count - 1].isDynamic) { 232 new List<EntityRefBuilder>(count);
235 count--; 233 for (int i = 0; i < count; i++) {
236 } else { 234 encodedTypeArguments[i] = _createLinkedType(
237 List<EntityRefBuilder> encodedTypeArguments = 235 typeArguments[i], compilationUnit, typeParameterContext);
238 new List<EntityRefBuilder>(count);
239 for (int i = 0; i < count; i++) {
240 encodedTypeArguments[i] = _createLinkedType(
241 typeArguments[i], compilationUnit, typeParameterContext);
242 }
243 encodedType.typeArguments = encodedTypeArguments;
244 break;
245 }
246 } 236 }
237 encodedType.typeArguments = encodedTypeArguments;
247 } 238 }
248 239
249 /** 240 /**
250 * Type of the callback used by [link] and [relink] to request 241 * Type of the callback used by [link] and [relink] to request
251 * [LinkedLibrary] objects from other build units. 242 * [LinkedLibrary] objects from other build units.
252 */ 243 */
253 typedef LinkedLibrary GetDependencyCallback(String absoluteUri); 244 typedef LinkedLibrary GetDependencyCallback(String absoluteUri);
254 245
255 /** 246 /**
256 * Type of the callback used by [link] and [relink] to request 247 * Type of the callback used by [link] and [relink] to request
(...skipping 4264 matching lines...) Expand 10 before | Expand all | Expand 10 after
4521 * there are no type parameters in scope. 4512 * there are no type parameters in scope.
4522 */ 4513 */
4523 TypeParameterizedElementForLink get _typeParameterContext; 4514 TypeParameterizedElementForLink get _typeParameterContext;
4524 4515
4525 @override 4516 @override
4526 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 4517 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
4527 4518
4528 @override 4519 @override
4529 String toString() => '$enclosingElement.$name'; 4520 String toString() => '$enclosingElement.$name';
4530 } 4521 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698