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

Unified Diff: dart/lib/compiler/implementation/elements/elements.dart

Issue 10836235: Check overrides. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 years, 4 months 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
« no previous file with comments | « dart/lib/compiler/implementation/closure.dart ('k') | dart/lib/compiler/implementation/enqueue.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/elements/elements.dart
diff --git a/dart/lib/compiler/implementation/elements/elements.dart b/dart/lib/compiler/implementation/elements/elements.dart
index b3b0fe1244ce38c34a44862a21098b5390c14576..55ad5dd436df0d6b1c0695a72221d430c99cc7e1 100644
--- a/dart/lib/compiler/implementation/elements/elements.dart
+++ b/dart/lib/compiler/implementation/elements/elements.dart
@@ -274,6 +274,10 @@ class Element implements Hashable {
Element cloneTo(Element enclosing, DiagnosticListener listener) {
listener.cancel("Unimplemented cloneTo", element: this);
}
+
+ Link<Type> get allSupertypesAndSelf() {
+ return allSupertypes.prepend(new InterfaceType(this));
+ }
}
class ContainerElement extends Element {
@@ -1066,6 +1070,24 @@ class ClassElement extends ScopeContainerElement
if (e.modifiers.isStatic()) continue;
return e;
}
+ if (isInterface()) {
+ return lookupSuperInterfaceMember(memberName, getLibrary());
+ }
+ return null;
+ }
+
+ Element lookupSuperInterfaceMember(SourceString memberName,
+ LibraryElement fromLibrary) {
+ bool isPrivate = memberName.isPrivate();
+ for (Type t in interfaces) {
+ Element e = t.element.lookupLocalMember(memberName);
+ if (e === null) continue;
+ // Private members from a different library are not visible.
+ if (isPrivate && fromLibrary !== e.getLibrary()) continue;
+ // Static members are not inherited.
+ if (e.modifiers.isStatic()) continue;
+ return e;
+ }
return null;
}
« no previous file with comments | « dart/lib/compiler/implementation/closure.dart ('k') | dart/lib/compiler/implementation/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698