| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 } | 407 } |
| 408 } | 408 } |
| 409 } | 409 } |
| 410 node.visitChildren(this); | 410 node.visitChildren(this); |
| 411 } | 411 } |
| 412 | 412 |
| 413 visitClassNode(ClassNode node) { | 413 visitClassNode(ClassNode node) { |
| 414 assert(currentElement is ClassElement); | 414 assert(currentElement is ClassElement); |
| 415 makeElementPlaceholder(node.name, currentElement); | 415 makeElementPlaceholder(node.name, currentElement); |
| 416 node.visitChildren(this); | 416 node.visitChildren(this); |
| 417 if (node.defaultClause !== null) { |
| 418 // Can't just visit class node's default clause because of the bug in the |
| 419 // resolver, it just crashes when it meets type variable. |
| 420 Type defaultType = (currentElement as ClassElement).defaultClass; |
| 421 assert(defaultType !== null); |
| 422 makeTypePlaceholder(node.defaultClause.typeName, defaultType); |
| 423 visit(node.defaultClause.typeArguments); |
| 424 } |
| 417 } | 425 } |
| 418 | 426 |
| 419 visitTypedef(Typedef node) { | 427 visitTypedef(Typedef node) { |
| 420 assert(currentElement is TypedefElement); | 428 assert(currentElement is TypedefElement); |
| 421 makeElementPlaceholder(node.name, currentElement); | 429 makeElementPlaceholder(node.name, currentElement); |
| 422 node.visitChildren(this); | 430 node.visitChildren(this); |
| 423 } | 431 } |
| 424 } | 432 } |
| OLD | NEW |