mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Don't visit synthesized extensions twice.
Teach `getTopLevelDeclsWithAuxiliaryDecls` not to provide extension declarations, because those are covered by the synthesized file, which all clients need to walk anyway. Without this, we end up asserting in TBD generation about duplicate symbol visitation. Encountered while investigating rdar://108056018.
This commit is contained in:
@@ -4072,7 +4072,8 @@ void FileUnit::getTopLevelDeclsWithAuxiliaryDecls(
|
||||
getTopLevelDecls(nonExpandedDecls);
|
||||
for (auto *decl : nonExpandedDecls) {
|
||||
decl->visitAuxiliaryDecls([&](Decl *auxDecl) {
|
||||
results.push_back(auxDecl);
|
||||
if (!isa<ExtensionDecl>(auxDecl))
|
||||
results.push_back(auxDecl);
|
||||
});
|
||||
results.push_back(decl);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user