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}.")); |
381 continue; | 383 continue; |
382 } | 384 } |
383 | 385 |
384 void reportError(MessageKind errorKind, MessageKind infoKind) { | 386 void reportError(MessageKind errorKind, MessageKind infoKind) { |
385 reportMessage( | 387 reportMessage( |
386 inherited.element, MessageKind.INVALID_OVERRIDE_METHOD, () { | 388 inherited.element, MessageKind.INVALID_OVERRIDE_METHOD, () { |
387 compiler.reportError(declared.element, errorKind, | 389 compiler.reportError(declared.element, errorKind, |
388 {'name': declared.name.text, | 390 {'name': declared.name.text, |
389 'class': cls.thisType, | 391 'class': cls.thisType, |
390 'inheritedClass': inherited.declarer}); | 392 'inheritedClass': inherited.declarer}); |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 message: "Members have not been fully computed for $this.")); | 910 message: "Members have not been fully computed for $this.")); |
909 if (interfaceMembersAreClassMembers) { | 911 if (interfaceMembersAreClassMembers) { |
910 classMembers.forEach((_, member) { | 912 classMembers.forEach((_, member) { |
911 if (!member.isStatic) f(member); | 913 if (!member.isStatic) f(member); |
912 }); | 914 }); |
913 } else { | 915 } else { |
914 interfaceMembers.forEach((_, member) => f(member)); | 916 interfaceMembers.forEach((_, member) => f(member)); |
915 } | 917 } |
916 } | 918 } |
917 } | 919 } |
OLD | NEW |