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

Side by Side Diff: pkg/kernel/lib/transformations/reify/transformation/builder.dart

Issue 2713163002: Pass type arguments as a list in generic methods invocations (Closed)
Patch Set: Created 3 years, 10 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 library kernel.transformations.reify.transformation.builder; 5 library kernel.transformations.reify.transformation.builder;
6 6
7 import '../asts.dart'; 7 import '../asts.dart';
8 import 'package:kernel/ast.dart'; 8 import 'package:kernel/ast.dart';
9 import 'dart:collection' show LinkedHashMap; 9 import 'dart:collection' show LinkedHashMap;
10 import 'binding.dart' show RuntimeLibrary; 10 import 'binding.dart' show RuntimeLibrary;
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 /// Helper to make recursive invocation more readable. 232 /// Helper to make recursive invocation more readable.
233 Expression createPart(DartType type) { 233 Expression createPart(DartType type) {
234 return createRuntimeType(type, 234 return createRuntimeType(type,
235 reifyTypeVariable: reifyTypeVariable, 235 reifyTypeVariable: reifyTypeVariable,
236 createReference: createReference, 236 createReference: createReference,
237 typeContext: typeContext); 237 typeContext: typeContext);
238 } 238 }
239 239
240 if (type is InterfaceType || type is Supertype) { 240 if (type is InterfaceType || type is Supertype) {
241 InterfaceType interfaceType = null; 241 InterfaceType interfaceType =
242 if (type is InterfaceType) { 242 (type is InterfaceType) ? type : (type as Supertype).asInterfaceType;
243 interfaceType = type;
244 } else {
245 interfaceType = (type as Supertype).asInterfaceType;
246 }
247 Class cls = interfaceType.classNode; 243 Class cls = interfaceType.classNode;
248 Expression declaration = createReference(cls); 244 Expression declaration = createReference(cls);
249 List<DartType> typeArguments = interfaceType.typeArguments; 245 List<DartType> typeArguments = interfaceType.typeArguments;
250 Expression typeArgumentList; 246 Expression typeArgumentList;
251 if (typeArguments.isNotEmpty) { 247 if (typeArguments.isNotEmpty) {
252 if (!reifyTypeVariable && matchesTypeParameters(typeArguments)) { 248 if (!reifyTypeVariable && matchesTypeParameters(typeArguments)) {
253 // The type argument list corresponds to the list of type parameters 249 // The type argument list corresponds to the list of type parameters
254 // and we are not in "declaration emitter" mode, we can reuse the 250 // and we are not in "declaration emitter" mode, we can reuse the
255 // type argument vector. 251 // type argument vector.
256 TypeParameterType parameterType = typeArguments[0]; 252 TypeParameterType parameterType = typeArguments[0];
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 declarations.type = declarationType; 498 declarations.type = declarationType;
503 } 499 }
504 500
505 Procedure createGetter( 501 Procedure createGetter(
506 Name name, Expression expression, Class cls, DartType type) { 502 Name name, Expression expression, Class cls, DartType type) {
507 return new Procedure(name, ProcedureKind.Getter, 503 return new Procedure(name, ProcedureKind.Getter,
508 new FunctionNode(new ReturnStatement(expression), returnType: type), 504 new FunctionNode(new ReturnStatement(expression), returnType: type),
509 fileUri: cls.fileUri); 505 fileUri: cls.fileUri);
510 } 506 }
511 } 507 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698