mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
Fix ClassElement.allSupertypes to include interfaces of mixins (issue 29767)
R=jmesserly@google.com Review-Url: https://codereview.chromium.org/3000183002 .
This commit is contained in:
parent
849998c5a9
commit
ebe2ce681e
|
@ -159,7 +159,7 @@ class B extends A1 with A2 {
|
|||
assertNotSuggested('foo');
|
||||
assertNotSuggested('A');
|
||||
assertSuggestField('x', 'int');
|
||||
assertSuggestMethod('y', 'A2', 'int');
|
||||
assertSuggestMethod('y', 'A1', 'int');
|
||||
assertSuggestField('x1', 'int');
|
||||
assertSuggestMethod('y1', 'A1', 'int');
|
||||
assertSuggestField('x2', 'int');
|
||||
|
|
|
@ -1154,14 +1154,11 @@ class ClassElementImpl extends AbstractClassElementImpl
|
|||
if (supertype != null) {
|
||||
typesToVisit.add(supertype);
|
||||
}
|
||||
for (InterfaceType type in currentElement.interfaces) {
|
||||
for (InterfaceType type in currentType.interfaces) {
|
||||
typesToVisit.add(type);
|
||||
}
|
||||
for (InterfaceType type in currentElement.mixins) {
|
||||
ClassElement element = type.element;
|
||||
if (!visitedClasses.contains(element)) {
|
||||
supertypes.add(type);
|
||||
}
|
||||
for (InterfaceType type in currentType.mixins) {
|
||||
typesToVisit.add(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -170,7 +170,7 @@ abstract class A<K, V> = Object with MapMixin<K, V>;
|
|||
List<InterfaceType> supers = classC.allSupertypes;
|
||||
List<InterfaceType> types = new List<InterfaceType>();
|
||||
types.addAll(supers);
|
||||
expect(types.contains(typeA), isFalse);
|
||||
expect(types.contains(typeA), isTrue);
|
||||
expect(types.contains(typeB), isTrue);
|
||||
expect(types.contains(typeObject), isTrue);
|
||||
expect(types.contains(typeC), isFalse);
|
||||
|
|
|
@ -159,7 +159,7 @@ class B extends A1 with A2 {
|
|||
assertNotSuggested('foo');
|
||||
assertNotSuggested('A');
|
||||
assertSuggestField('x', 'int');
|
||||
assertSuggestMethod('y', 'A2', 'int');
|
||||
assertSuggestMethod('y', 'A1', 'int');
|
||||
assertSuggestField('x1', 'int');
|
||||
assertSuggestMethod('y1', 'A1', 'int');
|
||||
assertSuggestField('x2', 'int');
|
||||
|
|
Loading…
Reference in a new issue