| 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 interface TreeElements { | 5 interface TreeElements { |
| 6 Element operator[](Node node); | 6 Element operator[](Node node); |
| 7 Selector getSelector(Send send); | 7 Selector getSelector(Send send); |
| 8 DartType getType(TypeAnnotation annotation); | 8 DartType getType(TypeAnnotation annotation); |
| 9 bool isParameterChecked(Element element); | 9 bool isParameterChecked(Element element); |
| 10 } | 10 } |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 ClassResolverVisitor visitor = | 276 ClassResolverVisitor visitor = |
| 277 new ClassResolverVisitor(compiler, element); | 277 new ClassResolverVisitor(compiler, element); |
| 278 visitor.visit(tree); | 278 visitor.visit(tree); |
| 279 element.resolutionState = STATE_DONE; | 279 element.resolutionState = STATE_DONE; |
| 280 })); | 280 })); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void checkMembers(ClassElement cls) { | 283 void checkMembers(ClassElement cls) { |
| 284 if (cls === compiler.objectClass) return; | 284 if (cls === compiler.objectClass) return; |
| 285 cls.forEachMember((holder, member) { | 285 cls.forEachMember((holder, member) { |
| 286 // Perform various checks as side effect of "computing" the type. |
| 287 member.computeType(compiler); |
| 286 | 288 |
| 287 // Check modifiers. | 289 // Check modifiers. |
| 288 if (member.isFunction() && member.modifiers.isFinal()) { | 290 if (member.isFunction() && member.modifiers.isFinal()) { |
| 289 compiler.reportMessage( | 291 compiler.reportMessage( |
| 290 compiler.spanFromElement(member), | 292 compiler.spanFromElement(member), |
| 291 MessageKind.ILLEGAL_FINAL_METHOD_MODIFIER.error(), | 293 MessageKind.ILLEGAL_FINAL_METHOD_MODIFIER.error(), |
| 292 api.Diagnostic.ERROR); | 294 api.Diagnostic.ERROR); |
| 293 } | 295 } |
| 294 if (member.isConstructor()) { | 296 if (member.isConstructor()) { |
| 295 final mismatchedFlagsBits = | 297 final mismatchedFlagsBits = |
| (...skipping 2458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2754 | 2756 |
| 2755 Element localLookup(SourceString name) => library.find(name); | 2757 Element localLookup(SourceString name) => library.find(name); |
| 2756 Element lookup(SourceString name) => localLookup(name); | 2758 Element lookup(SourceString name) => localLookup(name); |
| 2757 Element lexicalLookup(SourceString name) => localLookup(name); | 2759 Element lexicalLookup(SourceString name) => localLookup(name); |
| 2758 | 2760 |
| 2759 Element add(Element newElement) { | 2761 Element add(Element newElement) { |
| 2760 throw "Cannot add an element in the top scope"; | 2762 throw "Cannot add an element in the top scope"; |
| 2761 } | 2763 } |
| 2762 String toString() => '$element'; | 2764 String toString() => '$element'; |
| 2763 } | 2765 } |
| OLD | NEW |