Chromium Code Reviews| Index: compiler/java/com/google/dart/compiler/resolver/ClassScope.java |
| =================================================================== |
| --- compiler/java/com/google/dart/compiler/resolver/ClassScope.java (revision 8609) |
| +++ compiler/java/com/google/dart/compiler/resolver/ClassScope.java (working copy) |
| @@ -31,25 +31,31 @@ |
| InterfaceType superclass = classElement.getSupertype(); |
| if (superclass != null) { |
| Element enclosing = superclass.getElement().getEnclosingElement(); |
| - ClassScope scope = new ClassScope(superclass.getElement(), |
| - new Scope("library", (LibraryElement) enclosing)); |
| - element = scope.findElement(inLibrary, name); |
| - switch (ElementKind.of(element)) { |
| - case TYPE_VARIABLE: |
| - return null; |
| - case NONE: |
| - break; |
| - default: |
| - return element; |
| + ClassElement superclassElement = superclass.getElement(); |
| + if (superclassElement != classElement) { |
|
scheglov
2012/06/13 21:07:26
Will this cause problem?
Can we add such test?
cla
Brian Wilkerson
2012/06/13 21:22:44
Yes, it probably will. I'd like to fix that as par
|
| + ClassScope scope = new ClassScope(superclassElement, |
| + new Scope("library", (LibraryElement) enclosing)); |
| + element = scope.findElement(inLibrary, name); |
| + switch (ElementKind.of(element)) { |
| + case TYPE_VARIABLE: |
| + return null; |
| + case NONE: |
| + break; |
| + default: |
| + return element; |
| + } |
| } |
| } |
| for (InterfaceType supertype : classElement.getInterfaces()) { |
| Element enclosing = supertype.getElement().getEnclosingElement(); |
| - ClassScope scope = new ClassScope(supertype.getElement(), |
| - new Scope("library", (LibraryElement) enclosing)); |
| - element = scope.findElement(inLibrary, name); |
| - if (element != null) { |
| - return element; |
| + ClassElement superclassElement = supertype.getElement(); |
| + if (superclassElement != classElement) { |
| + ClassScope scope = new ClassScope(superclassElement, |
| + new Scope("library", (LibraryElement) enclosing)); |
| + element = scope.findElement(inLibrary, name); |
| + if (element != null) { |
| + return element; |
| + } |
| } |
| } |
| return null; |