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

Side by Side Diff: pkg/compiler/lib/src/resolution/signatures.dart

Issue 2535213003: Support patched generic methods. (Closed)
Patch Set: Add tests for renaming. Created 4 years 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/compiler/lib/src/patch_parser.dart ('k') | tests/compiler/dart2js/patch_test.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 dart2js.resolution.signatures; 5 library dart2js.resolution.signatures;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/resolution.dart'; 8 import '../common/resolution.dart';
9 import '../dart_types.dart'; 9 import '../dart_types.dart';
10 import '../elements/elements.dart'; 10 import '../elements/elements.dart';
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 NodeList formalParameters, 300 NodeList formalParameters,
301 Node returnNode, 301 Node returnNode,
302 FunctionTypedElement element, 302 FunctionTypedElement element,
303 ResolutionRegistry registry, 303 ResolutionRegistry registry,
304 {MessageKind defaultValuesError, 304 {MessageKind defaultValuesError,
305 bool createRealParameters: false, 305 bool createRealParameters: false,
306 bool isFunctionExpression: false}) { 306 bool isFunctionExpression: false}) {
307 DiagnosticReporter reporter = resolution.reporter; 307 DiagnosticReporter reporter = resolution.reporter;
308 308
309 List<DartType> createTypeVariables(NodeList typeVariableNodes) { 309 List<DartType> createTypeVariables(NodeList typeVariableNodes) {
310 if (element.isPatch) {
311 FunctionTypedElement origin = element.origin;
312 origin.computeType(resolution);
313 return origin.typeVariables;
314 }
310 if (typeVariableNodes == null) return const <DartType>[]; 315 if (typeVariableNodes == null) return const <DartType>[];
311 316
312 // Create the types and elements corresponding to [typeVariableNodes]. 317 // Create the types and elements corresponding to [typeVariableNodes].
313 Link<Node> nodes = typeVariableNodes.nodes; 318 Link<Node> nodes = typeVariableNodes.nodes;
314 List<DartType> arguments = 319 List<DartType> arguments =
315 new List.generate(nodes.slowLength(), (int index) { 320 new List.generate(nodes.slowLength(), (int index) {
316 TypeVariable node = nodes.head; 321 TypeVariable node = nodes.head;
317 String variableName = node.name.source; 322 String variableName = node.name.source;
318 nodes = nodes.tail; 323 nodes = nodes.tail;
319 TypeVariableElementX variableElement = 324 TypeVariableElementX variableElement =
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 /// variables of the function signature itself when its signature is analyzed. 482 /// variables of the function signature itself when its signature is analyzed.
478 class FunctionSignatureBuildingScope extends TypeVariablesScope { 483 class FunctionSignatureBuildingScope extends TypeVariablesScope {
479 @override 484 @override
480 final List<DartType> typeVariables; 485 final List<DartType> typeVariables;
481 486
482 FunctionSignatureBuildingScope(Scope parent, this.typeVariables) 487 FunctionSignatureBuildingScope(Scope parent, this.typeVariables)
483 : super(parent); 488 : super(parent);
484 489
485 String toString() => 'FunctionSignatureBuildingScope($typeVariables)'; 490 String toString() => 'FunctionSignatureBuildingScope($typeVariables)';
486 } 491 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/patch_parser.dart ('k') | tests/compiler/dart2js/patch_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698