Chromium Code Reviews| 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 03895b2087442c5c6508b957b756e0c79043ea58..f111cd254a84bca80cfca2ca26d5131676e4af59 100644 |
| --- a/dart/lib/compiler/implementation/elements/elements.dart |
| +++ b/dart/lib/compiler/implementation/elements/elements.dart |
| @@ -275,6 +275,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 { |
| @@ -1075,9 +1079,25 @@ class ClassElement extends ContainerElement |
| if (e.modifiers.isStatic()) continue; |
| return e; |
| } |
| + if (isInterface()) { |
| + return lookupSuperInterfaceMember(memberName, getLibrary()); |
| + } |
| return null; |
| } |
| + Element lookupSuperInterfaceMember(SourceString memberName, |
| + LibraryElement fromLibrary) { |
| + 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 (memberName.isPrivate() && fromLibrary !== e.getLibrary()) continue; |
|
karlklose
2012/08/14 11:06:51
You could store the result of memberName.isPrivate
ahe
2012/08/14 18:20:34
Done.
|
| + // Static members are not inherited. |
| + if (e.modifiers.isStatic()) continue; |
| + return e; |
| + } |
| + } |
|
karlklose
2012/08/14 11:06:51
I would prefer an explicit 'return null' here.
ahe
2012/08/14 18:20:34
Done.
|
| + |
| /** |
| * Find the first member in the class chain with the given |
| * [memberName]. This method is NOT to be used for resolving |