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

Side by Side Diff: lib/compiler/implementation/dart_backend/placeholder_collector.dart

Issue 10834390: .resolveTypeAnnotation now returns TypedefType, not FunctionType. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class LocalPlaceholder implements Hashable { 5 class LocalPlaceholder implements Hashable {
6 final String identifier; 6 final String identifier;
7 final Set<Node> nodes; 7 final Set<Node> nodes;
8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); 8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>();
9 int hashCode() => identifier.hashCode(); 9 int hashCode() => identifier.hashCode();
10 String toString() => 10 String toString() =>
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 SourceString name = node.typeName.asIdentifier().source; 341 SourceString name = node.typeName.asIdentifier().source;
342 for (TypeVariable parameter in typeParameters) { 342 for (TypeVariable parameter in typeParameters) {
343 if (parameter.name.source == name) { 343 if (parameter.name.source == name) {
344 // type annotation matches one of parameters, shouldn't be renamed. 344 // type annotation matches one of parameters, shouldn't be renamed.
345 return; 345 return;
346 } 346 }
347 } 347 }
348 } 348 }
349 } 349 }
350 final type = compiler.resolveTypeAnnotation(currentElement, node); 350 final type = compiler.resolveTypeAnnotation(currentElement, node);
351 if (type is InterfaceType || type is FunctionType) { 351 if (type is InterfaceType || type is TypedefType) {
352 var target = node.typeName; 352 var target = node.typeName;
353 if (node.typeName is Send) { 353 if (node.typeName is Send) {
354 final element = treeElements[node]; 354 final element = treeElements[node];
355 if (element !== null) { 355 if (element !== null) {
356 final send = node.typeName.asSend(); 356 final send = node.typeName.asSend();
357 Identifier receiver = send.receiver; 357 Identifier receiver = send.receiver;
358 Identifier selector = send.selector; 358 Identifier selector = send.selector;
359 final hasPrefix = element is TypedefElement || 359 final hasPrefix = element is TypedefElement ||
360 element.lookupConstructor(receiver.source, selector.source) 360 element.lookupConstructor(receiver.source, selector.source)
361 === null; 361 === null;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 makeElementPlaceholder(node.name, currentElement); 422 makeElementPlaceholder(node.name, currentElement);
423 node.visitChildren(this); 423 node.visitChildren(this);
424 } 424 }
425 425
426 visitTypedef(Typedef node) { 426 visitTypedef(Typedef node) {
427 assert(currentElement is TypedefElement); 427 assert(currentElement is TypedefElement);
428 makeElementPlaceholder(node.name, currentElement); 428 makeElementPlaceholder(node.name, currentElement);
429 node.visitChildren(this); 429 node.visitChildren(this);
430 } 430 }
431 } 431 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698