Skip to content

Commit 8abc964

Browse files
scheglovCommit Queue
authored andcommitted
Fine. Prevent infinite recursion in _fillInterfaceElementsInterface().
No new tests, but existing tests, e.g. RecursiveInterfaceInheritanceTest | test_class_implements were failing if the flag was enabled for all analyzer tests. Change-Id: I916948d976fe4ae1223df21a2caec2ec1322de57 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444521 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Johnni Winther <[email protected]>
1 parent 644f141 commit 8abc964

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/analyzer/lib/src/fine/library_manifest.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,19 +881,24 @@ class LibraryManifestBuilder {
881881
void _fillInterfaceElementsInterface() {
882882
var librarySet = libraryElements.toSet();
883883
var interfaceSet = <InterfaceElementImpl>{};
884+
var interfaceList = <InterfaceElementImpl>[];
884885

885886
void addInterfacesToFill(InterfaceElementImpl element) {
886887
// If not in this bundle, it has interface ready.
887888
if (!librarySet.contains(element.library)) {
888889
return;
889890
}
890891

892+
if (!interfaceSet.add(element)) {
893+
return;
894+
}
895+
891896
// Ensure that we have interfaces of supertypes first.
892897
for (var superType in element.allSupertypes) {
893898
addInterfacesToFill(superType.element);
894899
}
895900

896-
interfaceSet.add(element);
901+
interfaceList.add(element);
897902
}
898903

899904
for (var libraryElement in libraryElements) {
@@ -908,7 +913,7 @@ class LibraryManifestBuilder {
908913
// So that if there are synthetic top-merged members in interfaces of
909914
// supertypes (these members are not included into declared), we can
910915
// get corresponding IDs.
911-
for (var element in interfaceSet) {
916+
for (var element in interfaceList) {
912917
_fillInterfaceElementInterface(element);
913918
}
914919
}

0 commit comments

Comments
 (0)