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 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 if (lookupElement == null) { | 1149 if (lookupElement == null) { |
1150 compiler.internalError(member, | 1150 compiler.internalError(member, |
1151 "No abstract field for accessor"); | 1151 "No abstract field for accessor"); |
1152 } else if (!identical(lookupElement.kind, ElementKind.ABSTRACT_FIELD)) { | 1152 } else if (!identical(lookupElement.kind, ElementKind.ABSTRACT_FIELD)) { |
1153 if (lookupElement.isErroneous || lookupElement.isAmbiguous) return; | 1153 if (lookupElement.isErroneous || lookupElement.isAmbiguous) return; |
1154 compiler.internalError(member, | 1154 compiler.internalError(member, |
1155 "Inaccessible abstract field for accessor"); | 1155 "Inaccessible abstract field for accessor"); |
1156 } | 1156 } |
1157 AbstractFieldElement field = lookupElement; | 1157 AbstractFieldElement field = lookupElement; |
1158 | 1158 |
1159 FunctionElementX getter = field.getter; | 1159 MethodElementX getter = field.getter; |
1160 if (getter == null) return; | 1160 if (getter == null) return; |
1161 FunctionElementX setter = field.setter; | 1161 MethodElementX setter = field.setter; |
1162 if (setter == null) return; | 1162 if (setter == null) return; |
1163 int getterFlags = getter.modifiers.flags | Modifiers.FLAG_ABSTRACT; | 1163 int getterFlags = getter.modifiers.flags | Modifiers.FLAG_ABSTRACT; |
1164 int setterFlags = setter.modifiers.flags | Modifiers.FLAG_ABSTRACT; | 1164 int setterFlags = setter.modifiers.flags | Modifiers.FLAG_ABSTRACT; |
1165 if (!identical(getterFlags, setterFlags)) { | 1165 if (!identical(getterFlags, setterFlags)) { |
1166 final mismatchedFlags = | 1166 final mismatchedFlags = |
1167 new Modifiers.withFlags(null, getterFlags ^ setterFlags); | 1167 new Modifiers.withFlags(null, getterFlags ^ setterFlags); |
1168 compiler.reportError( | 1168 compiler.reportError( |
1169 field.getter, | 1169 field.getter, |
1170 MessageKind.GETTER_MISMATCH, | 1170 MessageKind.GETTER_MISMATCH, |
1171 {'modifiers': mismatchedFlags}); | 1171 {'modifiers': mismatchedFlags}); |
(...skipping 3987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5159 } | 5159 } |
5160 | 5160 |
5161 /// The result for the resolution of the `assert` method. | 5161 /// The result for the resolution of the `assert` method. |
5162 class AssertResult implements ResolutionResult { | 5162 class AssertResult implements ResolutionResult { |
5163 const AssertResult(); | 5163 const AssertResult(); |
5164 | 5164 |
5165 Element get element => null; | 5165 Element get element => null; |
5166 | 5166 |
5167 String toString() => 'AssertResult()'; | 5167 String toString() => 'AssertResult()'; |
5168 } | 5168 } |
OLD | NEW |