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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 } | 371 } |
372 } | 372 } |
373 | 373 |
374 DartType declaredType = declared.functionType; | 374 DartType declaredType = declared.functionType; |
375 for (Member inherited in superMember.declarations) { | 375 for (Member inherited in superMember.declarations) { |
376 if (inherited.element == declared.element) { | 376 if (inherited.element == declared.element) { |
377 // TODO(ahe): For some reason, "call" elements are repeated in | 377 // TODO(ahe): For some reason, "call" elements are repeated in |
378 // superMember.declarations. Investigate why. | 378 // superMember.declarations. Investigate why. |
379 } else if (cls == inherited.declarer.element) { | 379 } else if (cls == inherited.declarer.element) { |
380 // An error should already have been reported. | 380 // An error should already have been reported. |
381 assert(invariant(declared.element, compiler.compilationFailed)); | 381 assert(invariant(declared.element, compiler.compilationFailed, |
382 message: "Member $inherited inherited from its " | |
383 "declaring class: ${cls}.")); | |
Siggi Cherem (dart-lang)
2015/09/01 20:13:40
Not sure I follow the message, does this indicate
| |
382 continue; | 384 continue; |
383 } | 385 } |
384 | 386 |
385 void reportError(MessageKind errorKind, MessageKind infoKind) { | 387 void reportError(MessageKind errorKind, MessageKind infoKind) { |
386 reportMessage( | 388 reportMessage( |
387 inherited.element, MessageKind.INVALID_OVERRIDE_METHOD, () { | 389 inherited.element, MessageKind.INVALID_OVERRIDE_METHOD, () { |
388 compiler.reportError(declared.element, errorKind, | 390 compiler.reportError(declared.element, errorKind, |
389 {'name': declared.name.text, | 391 {'name': declared.name.text, |
390 'class': cls.thisType, | 392 'class': cls.thisType, |
391 'inheritedClass': inherited.declarer}); | 393 'inheritedClass': inherited.declarer}); |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
909 message: "Members have not been fully computed for $this.")); | 911 message: "Members have not been fully computed for $this.")); |
910 if (interfaceMembersAreClassMembers) { | 912 if (interfaceMembersAreClassMembers) { |
911 classMembers.forEach((_, member) { | 913 classMembers.forEach((_, member) { |
912 if (!member.isStatic) f(member); | 914 if (!member.isStatic) f(member); |
913 }); | 915 }); |
914 } else { | 916 } else { |
915 interfaceMembers.forEach((_, member) => f(member)); | 917 interfaceMembers.forEach((_, member) => f(member)); |
916 } | 918 } |
917 } | 919 } |
918 } | 920 } |
OLD | NEW |