| 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 library dart2js.resolution.compute_members; | 5 library dart2js.resolution.compute_members; |
| 6 | 6 |
| 7 import '../common/names.dart' show | 7 import '../common/names.dart' show |
| 8 Identifiers; | 8 Identifiers; |
| 9 import '../compiler.dart' show | 9 import '../compiler.dart' show |
| 10 Compiler; | 10 Compiler; |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 } | 370 } |
| 371 } | 371 } |
| 372 | 372 |
| 373 DartType declaredType = declared.functionType; | 373 DartType declaredType = declared.functionType; |
| 374 for (Member inherited in superMember.declarations) { | 374 for (Member inherited in superMember.declarations) { |
| 375 if (inherited.element == declared.element) { | 375 if (inherited.element == declared.element) { |
| 376 // TODO(ahe): For some reason, "call" elements are repeated in | 376 // TODO(ahe): For some reason, "call" elements are repeated in |
| 377 // superMember.declarations. Investigate why. | 377 // superMember.declarations. Investigate why. |
| 378 } else if (cls == inherited.declarer.element) { | 378 } else if (cls == inherited.declarer.element) { |
| 379 // An error should already have been reported. | 379 // An error should already have been reported. |
| 380 assert(invariant(declared.element, compiler.compilationFailed, | 380 assert(invariant(declared.element, compiler.compilationFailed)); |
| 381 message: "Member $inherited inherited from its " | |
| 382 "declaring class: ${cls}.")); | |
| 383 continue; | 381 continue; |
| 384 } | 382 } |
| 385 | 383 |
| 386 void reportError(MessageKind errorKind, MessageKind infoKind) { | 384 void reportError(MessageKind errorKind, MessageKind infoKind) { |
| 387 reportMessage( | 385 reportMessage( |
| 388 inherited.element, MessageKind.INVALID_OVERRIDE_METHOD, () { | 386 inherited.element, MessageKind.INVALID_OVERRIDE_METHOD, () { |
| 389 compiler.reportError(declared.element, errorKind, | 387 compiler.reportError(declared.element, errorKind, |
| 390 {'name': declared.name.text, | 388 {'name': declared.name.text, |
| 391 'class': cls.thisType, | 389 'class': cls.thisType, |
| 392 'inheritedClass': inherited.declarer}); | 390 'inheritedClass': inherited.declarer}); |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 message: "Members have not been fully computed for $this.")); | 908 message: "Members have not been fully computed for $this.")); |
| 911 if (interfaceMembersAreClassMembers) { | 909 if (interfaceMembersAreClassMembers) { |
| 912 classMembers.forEach((_, member) { | 910 classMembers.forEach((_, member) { |
| 913 if (!member.isStatic) f(member); | 911 if (!member.isStatic) f(member); |
| 914 }); | 912 }); |
| 915 } else { | 913 } else { |
| 916 interfaceMembers.forEach((_, member) => f(member)); | 914 interfaceMembers.forEach((_, member) => f(member)); |
| 917 } | 915 } |
| 918 } | 916 } |
| 919 } | 917 } |
| OLD | NEW |