Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1490)

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 18029018: Check that non-abstract classes implement all methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 3e04dc9fb3c24d8f3853847fbddfd11ebb96ef65..21a3d5cfd8c56f5acf8cc17ace03a72865e4ff84 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -916,6 +916,25 @@ class ResolverTask extends CompilerTask {
MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD);
}
}
+
+ if (!cls.isAbstract) {
+ for (DartType supertype in cls.allSupertypes) {
+ // This must have been reported elsewhere.
+ if (!supertype.element.isClass()) continue;
+ ClassElement superclass = supertype.element;
+ superclass.forEachMember((ClassElement holder, Element member) {
+ if (member.isAbstract) {
+ Element mine = cls.lookupMember(member.name);
+ if (mine == null || mine.isAbstract) {
+ compiler.reportWarningCode(
+ cls, MessageKind.UNIMPLEMENTED_METHOD,
+ {'class_name': cls.name, 'member_name': member.name});
+ compiler.reportHint(member, MessageKind.THIS_IS_THE_METHOD, {});
+ }
+ }
+ });
+ }
+ }
}
void checkAbstractField(Element member) {

Powered by Google App Engine
This is Rietveld 408576698