File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -124,17 +124,19 @@ abstract class Inheritable {
124124 searchElement = searchElement is Member
125125 ? Package .getBasestElement (searchElement)
126126 : searchElement;
127- bool foundElement = false ;
128127 // TODO(jcollins-g): generate warning if an inherited element's definition
129- // is in an intermediate non-canonical class in the inheritance chain
128+ // is in an intermediate non-canonical class in the inheritance chain?
130129 for (Class c in inheritance.reversed) {
131- if (! foundElement && c.contains (searchElement)) {
132- foundElement = true ;
133- }
134- Class canonicalC = package.findCanonicalModelElementFor (c.element);
135- if (canonicalC != null && foundElement) {
136- _canonicalEnclosingClass = c;
137- break ;
130+ // Filter out mixins.
131+ if (c.contains (searchElement)) {
132+ Class canonicalC = package.findCanonicalModelElementFor (c.element);
133+ // TODO(jcollins-g): invert this lookup so traversal is recursive
134+ // starting from the ModelElement.
135+ if (canonicalC != null ) {
136+ assert (canonicalC.contains (searchElement));
137+ _canonicalEnclosingClass = c;
138+ break ;
139+ }
138140 }
139141 }
140142 if (definingEnclosingElement.isCanonical) {
You can’t perform that action at this time.
0 commit comments