| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |