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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/ClassScope.java

Issue 10534145: Fix for issue 2155 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « no previous file | compiler/javatests/com/google/dart/compiler/resolver/ResolverCompilerTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/resolver/ResolverCompilerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698