| 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 2850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2861 {'class': compiler.mirrorSystemClass.name, | 2861 {'class': compiler.mirrorSystemClass.name, |
| 2862 'name': compiler.mirrorSystemGetNameFunction.name}); | 2862 'name': compiler.mirrorSystemGetNameFunction.name}); |
| 2863 } | 2863 } |
| 2864 | 2864 |
| 2865 if (target != null) { | 2865 if (target != null) { |
| 2866 if (target.isErroneous) { | 2866 if (target.isErroneous) { |
| 2867 registry.registerThrowNoSuchMethod(); | 2867 registry.registerThrowNoSuchMethod(); |
| 2868 } else if (target.isAbstractField) { | 2868 } else if (target.isAbstractField) { |
| 2869 AbstractFieldElement field = target; | 2869 AbstractFieldElement field = target; |
| 2870 target = field.getter; | 2870 target = field.getter; |
| 2871 if (target == null && !inInstanceContext) { | 2871 if (target == null) { |
| 2872 registry.registerThrowNoSuchMethod(); | 2872 if (!inInstanceContext || field.isTopLevel || field.isStatic) { |
| 2873 target = reportAndCreateErroneousElement(node.selector, field.name, | 2873 registry.registerThrowNoSuchMethod(); |
| 2874 MessageKind.CANNOT_RESOLVE_GETTER, const {}); | 2874 target = reportAndCreateErroneousElement(node.selector, field.name, |
| 2875 MessageKind.CANNOT_RESOLVE_GETTER, const {}); |
| 2876 } |
| 2875 } | 2877 } |
| 2876 } else if (target.isTypeVariable) { | 2878 } else if (target.isTypeVariable) { |
| 2877 ClassElement cls = target.enclosingClass; | 2879 ClassElement cls = target.enclosingClass; |
| 2878 assert(enclosingElement.enclosingClass == cls); | 2880 assert(enclosingElement.enclosingClass == cls); |
| 2879 if (!Elements.hasAccessToTypeVariables(enclosingElement)) { | 2881 if (!Elements.hasAccessToTypeVariables(enclosingElement)) { |
| 2880 compiler.reportError(node, | 2882 compiler.reportError(node, |
| 2881 MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER, | 2883 MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER, |
| 2882 {'typeVariableName': node.selector}); | 2884 {'typeVariableName': node.selector}); |
| 2883 } | 2885 } |
| 2884 registry.registerClassUsingVariableExpression(cls); | 2886 registry.registerClassUsingVariableExpression(cls); |
| (...skipping 2285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5170 } | 5172 } |
| 5171 | 5173 |
| 5172 /// The result for the resolution of the `assert` method. | 5174 /// The result for the resolution of the `assert` method. |
| 5173 class AssertResult implements ResolutionResult { | 5175 class AssertResult implements ResolutionResult { |
| 5174 const AssertResult(); | 5176 const AssertResult(); |
| 5175 | 5177 |
| 5176 Element get element => null; | 5178 Element get element => null; |
| 5177 | 5179 |
| 5178 String toString() => 'AssertResult()'; | 5180 String toString() => 'AssertResult()'; |
| 5179 } | 5181 } |
| OLD | NEW |