| 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 resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 abstract class TreeElements { | 7 abstract class TreeElements { |
| 8 AnalyzableElement get analyzedElement; | 8 AnalyzableElement get analyzedElement; |
| 9 Iterable<Node> get superUses; | 9 Iterable<Node> get superUses; |
| 10 | 10 |
| (...skipping 2743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2754 target = field.getter; | 2754 target = field.getter; |
| 2755 if (target == null && !inInstanceContext) { | 2755 if (target == null && !inInstanceContext) { |
| 2756 registry.registerThrowNoSuchMethod(); | 2756 registry.registerThrowNoSuchMethod(); |
| 2757 target = | 2757 target = |
| 2758 warnAndCreateErroneousElement(node.selector, field.name, | 2758 warnAndCreateErroneousElement(node.selector, field.name, |
| 2759 MessageKind.CANNOT_RESOLVE_GETTER); | 2759 MessageKind.CANNOT_RESOLVE_GETTER); |
| 2760 } | 2760 } |
| 2761 } else if (target.isTypeVariable) { | 2761 } else if (target.isTypeVariable) { |
| 2762 ClassElement cls = target.enclosingClass; | 2762 ClassElement cls = target.enclosingClass; |
| 2763 assert(enclosingElement.enclosingClass == cls); | 2763 assert(enclosingElement.enclosingClass == cls); |
| 2764 if (Elements.isInStaticContext(enclosingElement)) { |
| 2765 compiler.reportError(node, |
| 2766 MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER, |
| 2767 {'typeVariableName': node.selector}); |
| 2768 } |
| 2764 registry.registerClassUsingVariableExpression(cls); | 2769 registry.registerClassUsingVariableExpression(cls); |
| 2765 registry.registerTypeVariableExpression(); | 2770 registry.registerTypeVariableExpression(); |
| 2766 // Set the type of the node to [Type] to mark this send as a | 2771 // Set the type of the node to [Type] to mark this send as a |
| 2767 // type variable expression. | 2772 // type variable expression. |
| 2768 registry.registerTypeLiteral(node, target.computeType(compiler)); | 2773 registry.registerTypeLiteral(node, target.computeType(compiler)); |
| 2769 } else if (target.impliesType && (!sendIsMemberAccess || node.isCall)) { | 2774 } else if (target.impliesType && (!sendIsMemberAccess || node.isCall)) { |
| 2770 // Set the type of the node to [Type] to mark this send as a | 2775 // Set the type of the node to [Type] to mark this send as a |
| 2771 // type literal. | 2776 // type literal. |
| 2772 DartType type; | 2777 DartType type; |
| 2773 | 2778 |
| (...skipping 2208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4982 } | 4987 } |
| 4983 | 4988 |
| 4984 /// The result for the resolution of the `assert` method. | 4989 /// The result for the resolution of the `assert` method. |
| 4985 class AssertResult implements ResolutionResult { | 4990 class AssertResult implements ResolutionResult { |
| 4986 const AssertResult(); | 4991 const AssertResult(); |
| 4987 | 4992 |
| 4988 Element get element => null; | 4993 Element get element => null; |
| 4989 | 4994 |
| 4990 String toString() => 'AssertResult()'; | 4995 String toString() => 'AssertResult()'; |
| 4991 } | 4996 } |
| OLD | NEW |