| 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 part of dart_backend; | 5 part of dart_backend; |
| 6 | 6 |
| 7 class LocalPlaceholder { | 7 class LocalPlaceholder { |
| 8 final String identifier; | 8 final String identifier; |
| 9 final Set<Node> nodes; | 9 final Set<Node> nodes; |
| 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); | 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 if (node.defaultClause != null) { | 572 if (node.defaultClause != null) { |
| 573 // Can't just visit class node's default clause because of the bug in the | 573 // Can't just visit class node's default clause because of the bug in the |
| 574 // resolver, it just crashes when it meets type variable. | 574 // resolver, it just crashes when it meets type variable. |
| 575 DartType defaultType = classElement.defaultClass; | 575 DartType defaultType = classElement.defaultClass; |
| 576 assert(defaultType != null); | 576 assert(defaultType != null); |
| 577 makeTypePlaceholder(node.defaultClause.typeName, defaultType); | 577 makeTypePlaceholder(node.defaultClause.typeName, defaultType); |
| 578 visit(node.defaultClause.typeArguments); | 578 visit(node.defaultClause.typeArguments); |
| 579 } | 579 } |
| 580 } | 580 } |
| 581 | 581 |
| 582 visitNamedMixinApplication(NamedMixinApplication node) { |
| 583 ClassElement classElement = currentElement; |
| 584 makeElementPlaceholder(node.name, classElement); |
| 585 node.visitChildren(this); |
| 586 } |
| 587 |
| 582 bool tryResolveAndCollectTypeVariable( | 588 bool tryResolveAndCollectTypeVariable( |
| 583 TypeDeclarationElement typeDeclaration, Identifier name) { | 589 TypeDeclarationElement typeDeclaration, Identifier name) { |
| 584 // Hack for case when interface and default class are in different | 590 // Hack for case when interface and default class are in different |
| 585 // libraries, try to resolve type variable to default class type arg. | 591 // libraries, try to resolve type variable to default class type arg. |
| 586 // Example: | 592 // Example: |
| 587 // lib1: interface I<K> default C<K> {...} | 593 // lib1: interface I<K> default C<K> {...} |
| 588 // lib2: class C<K> {...} | 594 // lib2: class C<K> {...} |
| 589 if (typeDeclaration is ClassElement | 595 if (typeDeclaration is ClassElement |
| 590 && (typeDeclaration as ClassElement).defaultClass != null) { | 596 && (typeDeclaration as ClassElement).defaultClass != null) { |
| 591 typeDeclaration = (typeDeclaration as ClassElement).defaultClass.element; | 597 typeDeclaration = (typeDeclaration as ClassElement).defaultClass.element; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 617 | 623 |
| 618 visitBlock(Block node) { | 624 visitBlock(Block node) { |
| 619 for (Node statement in node.statements.nodes) { | 625 for (Node statement in node.statements.nodes) { |
| 620 if (statement is VariableDefinitions) { | 626 if (statement is VariableDefinitions) { |
| 621 makeVarDeclarationTypePlaceholder(statement); | 627 makeVarDeclarationTypePlaceholder(statement); |
| 622 } | 628 } |
| 623 } | 629 } |
| 624 node.visitChildren(this); | 630 node.visitChildren(this); |
| 625 } | 631 } |
| 626 } | 632 } |
| OLD | NEW |